1、應該將 css 放置于結構的上方(一般放置于 head 元素內)。css 是解釋型語言,firefox 和 ie 在等待 css 傳輸完成之前不會渲染任何東西。只有將 css 前置,才可在瀏覽器解析結構時,對頁面進行渲染。
this causes the blank white screen problem. the page is totally blank until the stylesheet at the bottom is downloaded, on the order of 6-10 seconds for this page. the browser is waiting for the stylesheet to be loaded before it renders anything else in the page, even the static text.
導致的問題就是,頁面會有一段時間“樸素”,突然之間又“華麗”,用戶體驗很不好。
2、盡量使用 <link rel=”stylesheet” href=”http://www.survivalescaperooms.com/style.css” type=”text/css”> 的樣式導入方式,而減少 @import 的使用,更勿使用多層嵌套的 @import 。因為在 ie 里, @import 相當于將 <link> 放在頁面尾部。
this is a valid syntax, but, even though it’s in the document’s head, it breaks progressive rendering and instead causes the blank white screen and flash of unstyled content problems.
新聞熱點
疑難解答