Page 1 of 1
How is CSS faster than ...
Posted: Mon Sep 15, 2003 7:38 pm
by nigma
How is the use of CSS ( body { background-color: red; } ) faster than specifying the attribute in the HTML code ( <body bgcolor="red"> )?
Thanks for any help provided.
Posted: Mon Sep 15, 2003 7:44 pm
by scorphus
Just a clue: maybe because the CSS file is saved to the browser's cache and then it does not need to be reloaded. Considering you are using a CSS file, something like:
Code: Select all
<link rel="stylesheet" type="text/css" href="sc_style.css" />
and other pages of your application make use of it.
Regards,
Scorphus.
Posted: Mon Sep 15, 2003 7:57 pm
by brewmiser
The only way that I know that a CSS is faster is when it comes to design issues. It makes it easier to change multiple pages in one file then in all of them.
In case you do not like your webpage with a background color of red you can go to the CSS and change the color to blue.....and....wam bam .... it's done through out the entire site!
Posted: Mon Sep 15, 2003 8:04 pm
by nigma
Alright, thanks a lot, I didn't know the CSS file was stored in Cache.
Posted: Mon Sep 15, 2003 9:29 pm
by jason
Simply put a properly designed XHTML and CSS site weigh's much less than a traditional table-based site design. Because the CSS is the same on the pages, it's cached (just like an image would be).
So the only thing a browser downloads is the XHTML, which, if done correctly, is very, very light.
Posted: Tue Sep 16, 2003 6:30 pm
by Unipus
Correct. It's faster only when they are multiple redundant instances of the same stylings. But, if you're designing and writing your CSS correctly, there should be.