Solved

Opera Hack

Posted on 2006-07-23
7
1,048 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 200 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 200 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
Technology Partners: 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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

730 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