is there a limit? (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


mtfm -> is there a limit? (11/30/2006 17:37:49)

Just curious--

is there a predefined limit to how long a CSS file can be?

The one for my company's site is 4,000+ lines. [sm=yikes.gif]




womble -> RE: is there a limit? (11/30/2006 18:12:48)

It's more important the size of the file size of your CSS file.

< 10kb is ideal. >20kb is not wise.




Tailslide -> RE: is there a limit? (12/1/2006 2:24:02)

4,000+ !!! There's no technical limit to the length of a stylesheet although as Womble says, you really don't want too big a file just for bandwidth reasons. But 4000+ !! Forgive me, but that can't be very efficient use of CSS. One of the good things about CSS is that you can re-use rules all over the place to make your life easier.

If anyone gets the time then I've no doubt that could be rationalised - you can combine rules that have the same info in them like this:

#sidebar, #footer, #contents {whatever}


You never know it might save you some money!




jaybee -> RE: is there a limit? (12/1/2006 7:11:21)

You can also split it out into more than one stylesheet.

One site where mine was getting a bit large, nowhere near that big mind you, I split it into layout and styles and called both sheets in from the page.




Nicole -> RE: is there a limit? (12/1/2006 22:44:57)

quote:

ORIGINAL: jaybee

You can also split it out into more than one stylesheet.

One site where mine was getting a bit large, nowhere near that big mind you, I split it into layout and styles and called both sheets in from the page.


Won't that still show up on the website optimizer's "total CSS size" though?

There's also the CSS Tweak that Womble posted about ages ago that compresses the styles for you.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875