| Author |
Topic Search Topic Options
|
nava
Newbie
Joined: 31 July 2009
Status: Offline
Points: 2
|
Topic: CSS documents Posted: 31 July 2009 at 6:42am |
|
Hi all
Can you have a CSS document that is too long?
I'm doing a new site and the CSS seems to be neverending, is it ok if there are lots of lines?
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Posted: 31 July 2009 at 8:11am |
|
I can't see why not, however you need to remember that the CSS file needs to be downloaded to the visitors browser, so the bigger the CSS file the slower your website will be.
|
|
|
 |
jamieellis
Newbie
Joined: 05 August 2009
Location: Bedfordshire
Status: Offline
Points: 2
|
Posted: 05 August 2009 at 8:45pm |
|
Wouldn't worry too much, it would have to be absolutely huge to slow down a modern broadband connection, and even hundreds of lines seems to be now problem for all the major browsers.
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Posted: 06 August 2009 at 12:29pm |
|
Thats is true but there are still allot of people on dial up connections. Also allot of people use mobile connections now which unless you are in a 3G area tend to crawl along at dial up speeds.
Large CSS files also contribute to your bandwidth allocation.
You maybe better off splitting up the CSS file into smaller CSS files then include only those CSS files that you need for a particular page rather than limping them all together and including the whole lot in every page.
|
|
|
 |
omergon
Newbie
Joined: 22 December 2009
Status: Offline
Points: 2
|
Posted: 22 December 2009 at 1:54pm |
|
I think it will not be problem unless your css size more than 20kb and beware more than 1 css, that slow downs browsers.
|
 |
Mamady
Newbie
Joined: 27 December 2009
Status: Offline
Points: 2
|
Posted: 27 December 2009 at 12:21pm |
|
there are no technical limits to the length of the css file, but as others have noted, its all about user experience.
What you may find is that your content is loaded, and then it suddenly "jumps" into place after the css file is downloaded and the page rerendered.
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Posted: 28 December 2009 at 9:33am |
|
Large CSS files also course a performance problem, as from memory I do recall reading an interesting article on this subject that mentioned that most browsers will stop loading in anymore content while they load in a CSS or JavaScript file, so it's best to keep these shorter if you want your page to load faster, or place the CSS within the page itself.
Other content such as the page itself and images will load in simultaneously, it's only when the browser goes to load in the CSS or JavaScript files will the browser stop simultaneously loading in other contant at the same time.
|
|
|
 |