Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can have a CSS read by Safari only?

Status
Not open for further replies.

shaunacg

Programmer
Aug 1, 2003
71
GB
Hi,

Is there anyway I can have a CSS stylesheet that is read only by the Safari browser, but not by any other browsers? Or atleast not by any Windows browsers?

Thanks
 
no. Stylesheets are determined by medium not browser (that is, if the browser understands medium-specific stylesheets and doesn't just pick one at random from the supplied ones).
 
Try consulting this:
Look if there is a specific hack just for Safari. But as far as I know, Safari renders CSS the same as Mozilla and Opera for Windows, so there shouldn't be a need for a special Safari stylesheet.
 
you can use a javascript/php/asp/cfm script to check the browser first and then link the appropriate stylesheet

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
on second thoughts not sure you can do it with php/asp/cfm but its possible with javascript.

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Ok, great I'll try it with javascript then. It's funny the problem I need to fix only exists on Safari and not Opera or Mozilla.
Thanks.
 
Note: I believe Safari does not handle CSS-P (positioning) correctly - at least the version that comes with MacOS 10.2 (?), and I don't believe there is a work-around. Apparently there is a newer Safari but it requires the latest MacOS (10.3?); I don't know if it handles CSS-P correctly.

The symptom I've seen is text on top of text. Microsoft's Outlook Web Access suffers from this, as do a handful of other webs I've browsed to.
 
microsoft pages are usually quite unfriendly to opera and safari browsers anyway....

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
I have created a couple of CSS positioned websites and all look perfectly ok in IE6, Mozilla, Netscape, Opera and Safari. I had to apply a couple of hacks for IE6 but never for Safari. Maybe it is not the browser that is at fault here but the code...
 
If you google you will find information about Safari CSS bugs. Again, they may be fixed in the latest Safari, but that requires the latest MacOS, which I haven't bought yet.
 
Server-Side (PHP/ASP/etc)
The Safari U-A string is given on the Safari Developer Site.
2. What is the Safari user-agent string?

The complete Safari user-agent string is:

Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/XX (KHTML, like Gecko) Safari/YY

...where XX is the version of Apple's web technology used by Safari and YY is the version of the Safari application.

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top