javascript - What is the difference between style tag written after body and before body
習慣沉默
習慣沉默 2017-05-19 10:26:04
0
6
1413

What is the difference between writing the style tag after the body and before the body?

習慣沉默
習慣沉默

reply all(6)
巴扎黑

Written in the head tag to facilitate progressive rendering by the browser (resources downloading->CSSOM+DOM->RenderTree(composite)->Layout->paint). For the specific rendering process, please refer to
http://blog.csdn.net/wozaixia...
Written after the body tag. Since the browser parses the HTML document line by line, when it parses the style sheet written at the end (external (coupled or written in the style tag) will cause the browser to stop the previous rendering and wait for the loading and parsing of the style sheet to be completed before re-rendering. FOUC may occur under IE in Windows (that is, the page flickering problem caused by style failure)

大家讲道理

Written at the end is to load the body first and then the style - what difference can there be? .

世界只因有你

Writing it at the back may cause FOUC, it is better to write it at the front

曾经蜡笔没有小新

Loading order, the front is loaded before the body, the last is loaded after the body is loaded, and then loaded

给我你的怀抱

This is related to the browser crawler. The crawler enters the HTML mode when loading the page. If it is written before the body, the page has not started to be displayed, and the page white screen effect will not appear; if it is written after the body, when crawling to the css code, the crawler enters the css. mode, a white screen may appear.

伊谢尔伦

Generally, styles are placed between the heads. If the style is placed at the bottom. It loads the tags and renders the styles. If it loads slowly, you'll see it dance.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!