Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Opera Hack

Posted on 2006-07-23
7
Medium Priority
?
1,081 Views
Last Modified: 2012-05-05
I want a line of CSS to only be applied in Opera 9 (or if possible Opera 8+) but not in Firefox or IE (or if possible other browsers like IEMac and Safari)

Is this possible through CSS hacks?
0
Comment
Question by:huji
  • 3
  • 3
7 Comments
 
LVL 4

Assisted Solution

by:jfredrickson
jfredrickson earned 800 total points
ID: 17163862
I am not aware of any, and after a quick Google search it appears that the only ones out there are for 6 and earlier.

Perhaps we can help you fix the problem in another way that doesn't require a hack?
0
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 800 total points
ID: 17164109
Opera 9 is a little to young to have well documented hacks.
Hacks rely on bad interpretation of the syntax defined in the standards, and Opera is one of the browsers that best follow the standards.
See here: http://www.webstandards.org/2006/07/20/acid2-and-opera-9-clarifications/

Why do you need to use a hack for Opera 9?
0
 
LVL 14

Author Comment

by:huji
ID: 17167071
I give an example. Check this page: http://fa.wikipedia.org/
Check it in IE and Firefox and Opera. Compare it with http://en.wikipedia.org/ (well you will need to hav Farsi installed to see the first page correctly.)
The first link from the tabs on the top of the page (equivallent to the "main page" tab in the English version) should appear with some space on its right, and it does except in Opera. Any idea how to fix it only in Opera?
Huji
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 17167917
no idea, rtl layout is not my area...
that layout is quite complicated (using absolute positioning) and probably especially designed for IE and FF...
there are clearly some differences between Opera and Firefox, but i have no idea which browser is right and which browser is wrong.
0
 
LVL 14

Author Comment

by:huji
ID: 17174112
well, in this special case, and as much as I've understood it, Opera is not rendering the page in an standard way. I'll try to find a way myself. Thanks for letting me know of the fact that no Opera 8+ hacks are availabe.
Huji
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 17175676
>  well, in this special case, and as much as I've understood it, Opera is not rendering the page in an standard way.
IMHO, the page is too complicated to find out who's wrong and who's right.  The particular issue should be isolated.  Firefox also has bugs, especially with lists.


> Thanks for letting me know of the fact that no Opera 8+ hacks are availabe.
There are some hacks but they are hard to find.

You can use the fact that Opera 9 supports media-queries:
http://www.w3.org/TR/2002/CR-css3-mediaqueries-20020708/#media1

Example here:
http://www.positioniseverything.net/articles/onetruelayout/verticalgrid#how-opera-4

Now, for compatibility with future browsers, a good hack should be based on some wrong interpretation of the CSS syntax, not on a correct interpretation of the CSS syntax.
In this case, if Opera is wrong and you use the media-queries to fix the wrong, you'll get unwanted side effects when other browsers will start supporting media-queries.

Unless you know the hack very well and you are sure it will be compatible with future browsers, I recommend using javascript to check the user-agent and include some additional CSS for the particular browser you need to fix.
0
 
LVL 14

Author Comment

by:huji
ID: 17182818
Well, if it was up to me, I'd check the UA on the server side. I don't care about those who change the UA of their browser, they'd pay the cost of it. :)
Thanks for sharing the idea
Huji
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question