頁(yè)面中CSS加載方式的優(yōu)化
更新時(shí)間:2008年03月26日 22:50:59 作者:
今天學(xué)到了css的加載優(yōu)化,原來(lái)用@import的方法是不對(duì)的
1、應(yīng)該將 CSS 放置于結(jié)構(gòu)的上方(一般放置于 head 元素內(nèi))。CSS 是解釋型語(yǔ)言,F(xiàn)irefox 和 IE 在等待 CSS 傳輸完成之前不會(huì)渲染任何東西。只有將 CSS 前置,才可在瀏覽器解析結(jié)構(gòu)時(shí),對(duì)頁(yè)面進(jìn)行渲染。
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.
導(dǎo)致的問題就是,頁(yè)面會(huì)有一段時(shí)間“樸素”,突然之間又“華麗”,用戶體驗(yàn)很不好。
2、盡量使用 <link rel=”stylesheet” href=”http://www.planabc/yuanxin.css” type=”text/css”> 的樣式導(dǎo)入方式,而減少 @import 的使用,更勿使用多層嵌套的 @import 。因?yàn)樵?nbsp;IE 里, @import 相當(dāng)于將 <link> 放在頁(yè)面尾部。
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.
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.
導(dǎo)致的問題就是,頁(yè)面會(huì)有一段時(shí)間“樸素”,突然之間又“華麗”,用戶體驗(yàn)很不好。
2、盡量使用 <link rel=”stylesheet” href=”http://www.planabc/yuanxin.css” type=”text/css”> 的樣式導(dǎo)入方式,而減少 @import 的使用,更勿使用多層嵌套的 @import 。因?yàn)樵?nbsp;IE 里, @import 相當(dāng)于將 <link> 放在頁(yè)面尾部。
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.
相關(guān)文章
是不是所有的商業(yè)網(wǎng)站都可以一推百靈?似乎不是。在推廣你的商業(yè)網(wǎng)站之前,你要先檢查網(wǎng)站的“裝備”是否合乎如下要求:網(wǎng)站信息內(nèi)容足夠豐富、準(zhǔn)確、及時(shí)(絕對(duì)不是公司簡(jiǎn)介的電子版);網(wǎng)站設(shè)計(jì)具有專業(yè)水準(zhǔn)(絕對(duì)不是初學(xué)者的涂鴉之作);你已經(jīng)明確網(wǎng)站目標(biāo)市場(chǎng)(如果你的目標(biāo)市場(chǎng)定位在8000萬(wàn)網(wǎng)民,恐怕我們幫不了你)。然后,你就可以參考下面的技巧來(lái)推廣你的網(wǎng)站啦。2008-04-04
高手總結(jié)分析如果利用baidu分詞算法分析之二(轉(zhuǎn))
高手總結(jié)分析如果利用baidu分詞算法分析之二(轉(zhuǎn))...2007-11-11
域名注冊(cè)的相關(guān)知識(shí)(新手必讀)
這篇文章主要介紹了域名注冊(cè)的相關(guān)知識(shí)(新手必讀)2007-03-03
火車頭 V3_Dvbbs_7.1.0_Sp1 模塊及發(fā)布注意事項(xiàng) 下載
本文給大家分享的是火車頭 V3_Dvbbs_7.1.0_Sp1 模塊及發(fā)布注意事項(xiàng)以及模塊下載,需要的朋友可以參考下2007-04-04

