Is there a general rule of thumb? Is one preferable to the other in certain situations? Does an external SS load only once per website or with each page refresh/page.
personal preference deffinetely comes in on external or internal. The length of the style sheet usually dictates my actions and how the reaction to viewing the code in the page is. eg: messy and hard to read!
on the style sheet being loaded with each refresh. only if you code for a no-cache situation will this happen. otherwise the style sheet is cached thus preventing a multiple lag in loading after the initial view.
____________________________________________________ get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
Thanks. I'm just trying to get some method to my coding.
Just to clarify. So if your SS is 50 lines and is internal, the browser would read in those 50 lines with each page load. If an external SS is used, it would only have to read those 50 lines once.
I know this isn't much time saved, but wouldn't that be preferable, especially given the ease of website modification with external SS?
the same concept from the external to internal sheet will apply as far as load time goes. The page will be cached just as the .css would be cached. again, unless a no-cache is involved.
The external file will take more resources to load the page just due to the extraction from a outside source when the link is interpruted by the browser. however from my exp. I have never noticed any amount of resource disabilities from a thousand line externally described css to a internal.
____________________________________________________ get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
My own personal preference is to use a single external CSS page wherever possible. If I must override a style, I'll do so in the document itself, but I'm loathe to for exactly the very same reasons I never use the <FONT> tag. basically, I follow the model for CSS -- separate document, then header section if I must override the style from the external doc, then specific element if I must override the header styles. That's the way they were designed, near as I can figure out.
This serves me two purposes:
[ol]
[li]I can maintain a single style file better than styles in a hundred different documents. This cannot be overstated.[/li]
[li]Pure throughput -- as long as the browser caches the CSS document (most will), it only downloads it once for the whole site. If I had styles in each page, then I would be making them download redundant things. Heck, if I had to define some wonky style for each page, then I've no business designing a site in the first place![/li]
[/ol]
Cheers,
Edward
"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
Just think of this... is Xmas and you want to change the color of your pages to match the season, or is Halloween, or mothers day.... anything.
I use not only one but several external pages with the same attributes and classes. with different colors and properties for each.
I have a list of external CSS files named like
main.css
main_xmaz.css
main_halloween.css
main_regular.css
main_anything.css
On my pages I have a Link to main.css only.
when a season comes I just rename my main.css to main_old.css and make a copy of one of the other files and rename the copy as main.css.
In less than 5 minutes my whole website has a different face.
Try that using internal CSS definitions and see how long it takes.
bottom line: go with external CSS.
grtfercho çB^]\.. "Imagination is more important than Knowledge" A. Einstein
again, this all is preference driven and has no to little technical resource concern on the site. Of course common sense tells us how we should do it.
____________________________________________________ get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
from the menu select "My DWFaq" >> "My DWfaq's Style" a new window will open select the style and see how the whole website changes in a snap.
can't beat that.
grtfercho çB^]\.. "Imagination is more important than Knowledge" A. Einstein
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.