문제

Okay, what is Amazon doing? They put all their CSS definitions in the <head> tag? I can see the purpose of saving requests, but it doesn't seem very dynamic to me.

Any ideas?

도움이 되었습니까?

해결책

That's very likely not hard-coded in there. It's probably more dynamic than you think. I don't know what set-up Amazon has, but I'm guessing they're using some sort of templating language to add those styles dynamically.

다른 팁

The <head> element is traditionally the place for CSS files because the browser will download the files at the beginning of the request.

For me it makes sense. Amazon is a high traffic website and reducing request is surley a good thing for them.

Why shouldn't it be dynamic? Where is the difference between including the CSS or including it via a link tag.

Putting the css on other place then head will trigger a rerendering of the side in some browsers. So if you put your css at the bottom of the page you get an unstyled page until the css is loaded and then the whole page will be rendered again with the new style rules. http://developer.yahoo.com/performance/rules.html#css_top

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top