Solved

Opera Hack

Posted on 2006-07-23
7
1,060 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

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!

Question has a verified solution.

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

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

628 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