当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > 优化CSS在网页中的加载方式

CSS样式表
网页页面原结构和CSS写法导致浏览器兼容问题
CSS经验:ul列表不正确使用的趋势
Styleneat帮助你容易阅读和更新CSS文件
CSS的内容注释和作者及文件版本注释
网页设计制作教程:CSS书写格式
将CSS按照层叠式结构化重新组织与构建
CSS教程之CSS盒模型
CSS 框架BlueTrip特性
IE7和FF浏览器中右下角图片广告
CSS实例:通过定义渐变边框给图片加阴影
网页选项卡TAB设计原则和应用案例教程
8个设计规范的表格Table CSS样式应用
CSS制作的背景动态变化的网页导航
网页选项卡TAB设计原则和应用案例教程
使用CSS给图片添加阴影的方法
WEBJX收集20个高质量的免费CSS模板
13个网页页面浏览器兼容性验证工具
11个用CSS样式表制作网页按钮的教材
CSS3属性使网站设计增强同时不消弱可用性
清理无用的CSS样式的几个有用工具

CSS样式表 中的 优化CSS在网页中的加载方式


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 78 ::
收藏到网摘: n/a


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.planabc/yuanxin.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.

扩展阅读:     《Flash of Unstyled Content (FOUC)》