Jump to content

How many style sheets do you...


straightryder

Recommended Posts

Usually only one if the site is not too complicated, with perhaps a separate stylesheet for Internet Explorer. If the site is complicated, then the above and perhaps another stylesheet for a gallery page or a multi level drop down menu. But then I don't do huge sites, so let's hear what others have to say.

Link to comment
Share on other sites

As many as you like, but it can get confusing.

 

Have a strategy, like

a css file stylesheet for general page layout, div sizes, margins, floats, etc.

a stylesheet for presentation, text colors, background colors, etc.

a stylesheet file for a drop down menu as styles in there probably won't conflict with any styles elsewhere

a stylesheet file for IE6 different styles to go in a conditional comment

Link to comment
Share on other sites

You can have as many stylesheets as you desire. For some it can be a bit busy and cluttered to have all your styles within one stylesheet. Here's my preferred example.

 

One for global stylings; one for structural layout; and one for menu(s).

 

global.css

layout.css

menu.css

 

I don't always do this because it depends on the complexity of the design.

 

It doesn't really matter how many stylesheets you have. What matters is how you navigate around the css to find the code you are looking for. If you find that locating certain styles within a 1000 lines of css code is a bit difficult then it would be ideal to split them up into a more managable group of stylesheets.

 

I had one old client that bought a template which had just two styelsheets one of which had over 3000 lines of css codes. It was brutal. The other stylesheet was for a IE conditional comment. A mere 3 lines of code.

Edited by newseed
Link to comment
Share on other sites

"A mere 3 lines of code."

 

your kidding, right?

 

Not at all. That particular short stylesheet was for IE6 conditional comment but I have since removed that and was able to apply it correctly in the main css stylesheet.

 

Oh, I had the daunting task to optimise that 3000 lines of css. It took almost a whole day but I was able to get it down to about 800 lines or so. Some people find this to be way too many still but when I say that there about 800 lines, my lines are like this:

 

#container{

width:970px;

padding:5px;

position: relative;

}

 

...which counts as 5 lines.

 

Some people do it this way:

 

#container{width:970px; padding:5px; position: relative;}

 

...which count as one line. However, this method is a bit more difficult to read through when editing which is why I use other format.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...