General CSS usage advice needed

This is a discussion on "General CSS usage advice needed" within the Web Page Design section. This forum, and the thread "General CSS usage advice needed are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 19th, 2007, 09:23
dangergeek's Avatar
Moderator
Join Date: Feb 2007
Location: UK
Posts: 171
Thanks: 0
Thanked 2 Times in 2 Posts
General CSS usage advice needed

Hi

Currently bashing together using CSS (fairly new to it) and I just wanted peoples advice on browser compatibility.

IE6 & IE7 display slightly differently and I havent even looked at Firefox yet. Should I be looking to use 1 CSS style sheet that can cover all browser types? Is that the holy grail of CSS?

or

Do most people make multiple style sheets, one for each type of browser and let javascript decide which one to use? Seems more work but easiest way?

What do other people to do to acheive CSS happiness?
Reply With Quote

  #2 (permalink)  
Old Feb 19th, 2007, 14:23
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,646
Thanks: 0
Thanked 7 Times in 7 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: General CSS usage advice needed

Conditional comments and IE specific style sheets would be your best bet with 1 globals tyle sheet for everything.

http://www.quirksmode.org/css/condcom.html
__________________
I've got <style> and .class
Reply With Quote
  #3 (permalink)  
Old Feb 19th, 2007, 14:44
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: General CSS usage advice needed

As a self proclaimed guru, I use one style sheet doing my best to avoid "browser hacks." When you fully understand CSS, you'll think of multiple solutions to a problem. Provided you're not looking to achieve such things like attribute and pseudo selectors, comprehending normal CSS should be your first priority
Reply With Quote
  #4 (permalink)  
Old Feb 21st, 2007, 12:22
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: General CSS usage advice needed

Well, for the opposite p.o.v. I code for FF 2.0 as the primary stylesheet. I use a php browser sniffer and alternate style sheets for IE7, IE6, and Opera.
(I wouldn't consider myself an expert at CSS; I know a lot of stuff but it is all hit-or-miss.)

BTW, you just can't get by using javascript as the workhorse coding system after a certain point. For jobs like stylesheet-alternates, a server side code is far superior. For some things, javascript is simply not capable of doing the job, especially when it comes to security, such as form and email validation.
Reply With Quote
  #5 (permalink)  
Old Feb 21st, 2007, 15:30
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,646
Thanks: 0
Thanked 7 Times in 7 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: General CSS usage advice needed

Or just use conditional comments and not have to worry about scripting at all =P. Although I can see the great benefits to your method.
__________________
I've got <style> and .class
Reply With Quote
  #6 (permalink)  
Old Feb 22nd, 2007, 02:07
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: General CSS usage advice needed

The only problem with that is sometimes Firefox users change their user agent so they can work in IE only sites. Then FF people get the IE stylesheet.
Reply With Quote
  #7 (permalink)  
Old Feb 22nd, 2007, 10:14
dangergeek's Avatar
Moderator
Join Date: Feb 2007
Location: UK
Posts: 171
Thanks: 0
Thanked 2 Times in 2 Posts
Re: General CSS usage advice needed

Thanks for the comments guys

I'm not that great at CSS but my site is coming along nicely. I think I will opt for the browser sniffing with conditional comments. I would like to have 1 style sheet but dont have the skill.

It really sucks that different browsers display slightly differently. I am currently perplexed by this very problem so will start another thread with a new question.
Reply With Quote
  #8 (permalink)  
Old Feb 22nd, 2007, 15:07
dangergeek's Avatar
Moderator
Join Date: Feb 2007
Location: UK
Posts: 171
Thanks: 0
Thanked 2 Times in 2 Posts
Re: General CSS usage advice needed

Anybody know a good browser sniffer. I have tried searching the web but can't find any that work. (or I can get to work)
Reply With Quote
  #9 (permalink)  
Old Feb 22nd, 2007, 15:24
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: General CSS usage advice needed

Surely your site is not so complicated as to need a browser sniffer and load different stylesheet for different browsers?!

The conditional element are the way to go IMO. There are not that many hacks that you need to worry about. The only times I've used another stylesheet was to simple add the width IE6 was suppose to use (box-model hack).
Reply With Quote
  #10 (permalink)  
Old Feb 22nd, 2007, 15:38
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,646
Thanks: 0
Thanked 7 Times in 7 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: General CSS usage advice needed

Hacks for IE 6 etc break in 7 anyway. So you may as well just serve up IE specific versions as well. I wouldn't be too concerned with the users spoofing user agents.
__________________
I've got <style> and .class
Reply With Quote
  #11 (permalink)  
Old Feb 22nd, 2007, 15:43
dangergeek's Avatar
Moderator
Join Date: Feb 2007
Location: UK
Posts: 171
Thanks: 0
Thanked 2 Times in 2 Posts
Re: General CSS usage advice needed

Unfortunately as I am not a CSS genius like yourself it seemed the easiset choice to take. Especially as one of my fellow average CSS's suggested it was fine to do (see masonbarge's post above) It was why I asked this question in the first place!

I dont know everything about CSS so have to muddle along in my own way as many designers do. Stuff won't line up properly in different browsers. I thought this way would be more useful than posting loads of threads asking why this is doing that and why that is doing this.
Reply With Quote
  #12 (permalink)  
Old Feb 22nd, 2007, 15:50
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: General CSS usage advice needed

I would think that posting loads of questions would be better so you can understand why it's happening and how to fix it. Most the fixes you are talking about are simple things... you'd be surprise at how things are generally exagerated

Post your link so we can see what's happening and we can help you in the matter.
Reply With Quote
  #13 (permalink)  
Old Feb 22nd, 2007, 15:56
dangergeek's Avatar
Moderator
Join Date: Feb 2007
Location: UK
Posts: 171
Thanks: 0
Thanked 2 Times in 2 Posts
Re: General CSS usage advice needed

Cheers I will
Reply With Quote
  #14 (permalink)  
Old Feb 22nd, 2007, 15:57
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: General CSS usage advice needed

Good ... *sits tightly in the css forum and waits for dangergeeks' next thread *
Reply With Quote
  #15 (permalink)  
Old Feb 22nd, 2007, 16:05
dangergeek's Avatar
Moderator
Join Date: Feb 2007
Location: UK
Posts: 171
Thanks: 0
Thanked 2 Times in 2 Posts
Re: General CSS usage advice needed

But not tonight, work is over, i'm going home woo hoo
Reply With Quote
  #16 (permalink)  
Old Feb 22nd, 2007, 16:07
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: General CSS usage advice needed

Meh ... it's only lunchtime here
Reply With Quote
Reply

Tags
advice, browsers, css

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Advice Needed winnard2007 PHP Forum 4 Mar 13th, 2008 14:27
Advice Needed aman1335 Starting Out 4 Aug 11th, 2007 23:36
General Help needed davor2000 Web Page Design 4 Jun 12th, 2007 15:03
A little general advice need from a newb Towbar Introduce Yourself 3 Mar 17th, 2006 20:33
General question about your DB usage RaptorRex Databases 1 Aug 27th, 2005 08:29


All times are GMT. The time now is 13:12.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43