Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Opera Hack

Posted on 2006-07-23
7
Medium Priority
?
1,070 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 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Suggested Courses

715 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