Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Why embed the CSS in the HTML? (Read 4622 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Why embed the CSS in the HTML?

As far as I can tell every html file I retrieve from HydrogenAudio comes with 8KB of CSS. Why is this embedded in the HTML? Wouldn't it be quite a bit more efficient to put it in separate file and link to it with <link rel="stylesheet" href="somefile.css" type="text/css">?

Why embed the CSS in the HTML?

Reply #1
Perhaps it would be better to direct this question at Invision Power Board®.

Why embed the CSS in the HTML?

Reply #2
Don't think it makes a difference... When you link to an external stylesheet, you have to read the file anyway, so "bandwith-wise" it's the same...

But as Jan S. states, it's probably related to the board code... Can't do much about it, me thinks...
Jurg

Why embed the CSS in the HTML?

Reply #3
it's not true, after first loading css will then be cached if server gives the ccs a good expire time
the loading is like this for 5 pages
embed together
(html + css), (html + css), (html + css), (html + css), (html + css)
separate html and css
(html) + (css), (html), (html), (html), (html)

you save 4x css size's traffic

Why embed the CSS in the HTML?

Reply #4
Which in turn depends on your browser of course... And whether you use caching or not, and how often the browser checks the cache...

Right?
Jurg

Why embed the CSS in the HTML?

Reply #5
Invision Power Board gives you the ability to use external CSS.

Admin CP --> Skins & Templates --> Manage Skin Sets --> Edit --> Use Stylesheet --> External

Why embed the CSS in the HTML?

Reply #6
I'd add my vote to being as effecient as possible - use the linked CSS. If the end user wants tobe ineffecient, then so be it, but at least let the server be as effecient.
"There is no point in saving WAV... unless you have a huge HD in a very slow computer" - Jan S. (WAV or FLAC, Space No Problem)

Why embed the CSS in the HTML?

Reply #7
Quote
Which in turn depends on your browser of course... And whether you use caching or not, and how often the browser checks the cache...

Right?

all browsers at least cache pages from the current session, even if they throw them out on close. If they didn't, hitting the BACK button for instance would force a reload of all the images. It is an extremely good idea to use a single external stylesheet for bandwidth reasons. It's also easier from a site admin point of view (since you only need to maintain one document).

I'm a hardcore CSS and XHTML compliance nut...

Why embed the CSS in the HTML?

Reply #8
Quote
all browsers at least cache pages from the current session, even if they throw them out on close. If they didn't, hitting the BACK button for instance would force a reload of all the images.


Opera doen't cache at all when you turn it off, so you actually have to reload everything if you hit the 'back' button with cache off. I don't see why anyone would turn it off though

Why embed the CSS in the HTML?

Reply #9
...or use opera, for that matter


anyways, external css is always a good thing

who wants to edit multiple css entries? boooo


later

Why embed the CSS in the HTML?

Reply #10
The external CSS option has been used in the past, and probably will be again once I make the server move.  The reason it's not being used now relates to some of the custom modifications we are running on the board which cause problems with this option.

Why embed the CSS in the HTML?

Reply #11
Currently each page begins with about 22KB of CSS, that's quite a substantial amount. I'm on ADSL currently, so I don't experience any slowdowns myself (it probably takes more time to render the page than it takes to download it), but it seems like an awful waste of bandwidth to me. So perhaps it's time to turn on external stylesheets if at all possible.

Why embed the CSS in the HTML?

Reply #12
Quote
Currently each page begins with about 22KB of CSS, that's quite a substantial amount.
[a href="index.php?act=findpost&pid=254035"][{POST_SNAPBACK}][/a]

fyi, the embedded stylesheet actually makes a differenec of ~4.6KB in the page as delivered by the server.
A riddle is a short sword attached to the next 2000 years.

Why embed the CSS in the HTML?

Reply #13
Quote
fyi, the embedded stylesheet actually makes a differenec of ~4.6KB in the page as delivered by the server.
I understand it might not be a huge load for the viewer (I assume the server can send the pages in compressed form), but it's still a substantial percentage of the traffic. If it's difficult to set up and it's giving no problems on either the client or server side (in terms of load time or bandwidth usage), then I can understand the CSS is inlined, but if it's reasonably easy to set up then why not do it?