博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Rule 5: Put Stylesheets at the Top(Chapter 5 of High performance Web Sites)
阅读量:4629 次
发布时间:2019-06-09

本文共 1804 字,大约阅读时间需要 6 分钟。

      Frontend engineers who care about performance want a page to load progressively;
that is, we want the browser to display whatever content it has as soon as possible.
This is especially important for pages with a lot of content and for users on slower
Internet connections.The importance of giving users visual feedback has been well
researched and documented.
Here are the cases where putting stylesheets at the bottom of the document causes
the blank white screen problem to surface in Internet Explorer:
      In a new window
      Clicking the “new window” link in the example page opens “CSS at the Bottom”
in a new window.Users often open new windows when navigating across
sites, such as when going from a search results page to the actual target page.
      As a reload
      Clicking the Refresh button, a normal user behavior, is another way to trigger a
blank white screen.Minimize and restore the window while the page is loading
to see the blank white screen.
      As a home page
      Setting the browser’s default page to
and opening a new browser window causes the blank white screen.Rule 5 is
important for any team that wants its web site to be used as a home page.
      To avoid the blank white screen, move the stylesheet to the top in the document’s
HEAD.Doing this in the sample web site I’ve called “CSS at the Top” solves all the
problem scenarios.No matter how the page is loaded—whether in a new window, as
a reload, or as a home page—the page renders progressively.
      There are two ways you can include a stylesheet in your document: the LINK tag and
the @import rule. An example LINK tag looks like this:
      <link rel="stylesheet" href="styles1.css">
      This is an example of a STYLE block with an @import rule:
      <style>
      @import url("styles2.css");
      </style>

转载于:https://www.cnblogs.com/zhtf2014/archive/2009/10/12/1582088.html

你可能感兴趣的文章
android效果背景虚化
查看>>
jQuery效果:隐藏、显示、切换、滑动、淡入淡出、动画
查看>>
Java 学习笔记(4)——java 常见类
查看>>
IOS开源项目汇总
查看>>
用herl工具解决微信内链接或二维码可直接用外部浏览器打开
查看>>
GITHup的使用
查看>>
void main()是错的!
查看>>
Atitit. Attilax企业框架 AEF的发展里程总结
查看>>
亚麻 面经_ml
查看>>
豆瓣api
查看>>
SQL数据库无法附加 系统表损坏修复 数据库中病毒解密恢复
查看>>
JMeter的安装和使用
查看>>
Es5正则
查看>>
Unicode,UTF-32,UTF-16,UTF-8到底是啥关系?
查看>>
Git 版本还原命令
查看>>
【C#技术】一篇文章搞掂:Infragistics组件库
查看>>
记一次生产的bug
查看>>
ubuntu14.04上搭建android开发环境
查看>>
搭建nexus后,进入首页的时候出现warning: Could not connect to Nexus.错误
查看>>
Multithread 之 introduction
查看>>