Reply LinkBack Thread Tools Search this Thread
Old 17-06-2008, 03:31   #1 (permalink)
route609
Paul Wallas; Web Designer
 
Join Date: Feb 2008
Location: Nottingham
Posts: 44
Can you have Style Sheets for Safari

Hi

I need to know if its possible to have a style sheet or IF Safari script to show a div as a website i have coded is only different in safari?

Thanks

Paul

Last edited by route609 : 17-06-2008 at 04:40.
  Reply With Quote
Old 17-06-2008, 04:46   #2 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,488
It's possible to detect browsers via JavaScript, but best to try and fix your CSS.

Safari is a standards-compliant browser, you shouldn't have any issues coding to it at all
__________________
  Reply With Quote
Old 17-06-2008, 05:16   #3 (permalink)
funkyprem
For all your goober needs
 
funkyprem's Avatar
 
Join Date: Dec 2004
Location: Coventry, UK
Posts: 1,528
believe me cam, you do.

there used to be the ::root hack for safari but this doesn't work for version 3 anymore. not found one yet specifically for 3 but like you say cam, it is a hell of a lot better to code for than 2 was.
__________________
Time is really the only capital that any human being has, and the one thing that he can’t afford to lose. - Thomas Edison

prem ghinde
  Reply With Quote
Old 17-06-2008, 05:17   #4 (permalink)
d*d
Moderator
 
d*d's Avatar
 
Join Date: Oct 2004
Location: Bristol
Posts: 3,285
Safari can be a a bugger if you start absolutely positioning items
  Reply With Quote
Old 17-06-2008, 05:28   #5 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,488
Never had any issues with Safari. I'm obviously better than you lot.
__________________
  Reply With Quote
Old 17-06-2008, 05:44   #6 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,545
I had an issue with safari yesterday where some tables cells that I had set no border to had borders on them. Never managed to figure it out, but it wasn't a big deal so I just left it.
__________________
This space for rent.

Dads Japan
Dudes Japan
  Reply With Quote
Old 17-06-2008, 05:46   #7 (permalink)
route609
Paul Wallas; Web Designer
 
Join Date: Feb 2008
Location: Nottingham
Posts: 44
Quote:
Originally Posted by funkyprem
believe me cam, you do.

there used to be the ::root hack for safari but this doesn't work for version 3 anymore. not found one yet specifically for 3 but like you say cam, it is a hell of a lot better to code for than 2 was.


any idea what the root hack is as the problem is only happening on versions < 2

cheers
  Reply With Quote
Old 17-06-2008, 06:22   #8 (permalink)
d*d
Moderator
 
d*d's Avatar
 
Join Date: Oct 2004
Location: Bristol
Posts: 3,285
Quote:
Originally Posted by cam
Never had any issues with Safari. I'm obviously better than you lot.

We're out there pushing the technology to it's limits is all
  Reply With Quote
Old 17-06-2008, 06:34   #9 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,488
__________________
  Reply With Quote
Old 17-06-2008, 06:39   #10 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,638
Quote:
Originally Posted by route609
any idea what the root hack is as the problem is only happening on versions < 2

Safari CSS hack | theMechanism, llc.

Quote:
Please note that this hack does not work in Safari 3.
That sounds like what you want.
  Reply With Quote
Old 17-06-2008, 07:46   #11 (permalink)
herkalees
Semantics, yay.
 
herkalees's Avatar
 
Join Date: Nov 2005
Location: Salem, Massachusetts
Posts: 1,126
Try this quick thing I threw together. Note: my JavaScript skills aren't any good:
Code:
<script type="text/javascript"> var detect = navigator.userAgent.toLowerCase(); if (checkIt('safari')){ document.write('<link rel="stylesheet" type="text/css" href="styles/safari.css" media="screen, print" />'); } function checkIt(string){ var place = detect.indexOf(string) + 1; return place; } </script>
__________________
  Reply With Quote
Old 17-06-2008, 09:23   #12 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,672
For a long time now, I've designed using Safari and then tweaked for other browsers. I seem to have had waaaay less issues that way than any other approach I've taken.
  Reply With Quote
Old 17-06-2008, 09:58   #13 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,545
How do you tweak for firefox? I thought there were only conditional comments for IE.
__________________
This space for rent.

Dads Japan
Dudes Japan
  Reply With Quote
Old 17-06-2008, 10:53   #14 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,672
Quote:
Originally Posted by haku
How do you tweak for firefox? I thought there were only conditional comments for IE.

I didn't say I did. Although tweaking often involves simply adjusting here and there to fix layout issues in other browsers while preserving the original layout in your main development browser. It's not just about using conditionals to create different versions. A lot of it is about substituting alternative tag choices and CSS styles until you find something that works in all cases. Using actual different versions (i.e. using IE conditional statements) is a last resort - it's like an admission of failure.

Last edited by Hunch : 17-06-2008 at 11:05.
  Reply With Quote
Old 17-06-2008, 11:07   #15 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
I would recommend using the hack posted by Stickman rather then severing another css file using js detection... nothing but a wasted http request.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8