CSS样式表尽量放到网页头部


  从技术上讲,你可以将样式您想要的位置。
  不过, HTML规范的建议,将他们放在文件头标记。
  主要的好处是,您的网页加载速度似乎更快一些。
<head>  
    <title>应把所有CSS样式都放在Head Tag - www.phpstudy.net</title>  
    <link rel="stylesheet" type="text/css" media="screen" href="path/phpstudy.net/file.css" />  
    <link rel="stylesheet" type="text/css" media="screen" href="path/phpstudy.net/anotherFile.css" />  
</head>  

While researching performance at Yahoo!, we discovered that moving stylesheets to the document HEAD makes pages appear to be loading faster. This is because putting stylesheets in the HEAD allows the page to render progressively.
                                                                                                                       - ySlow Team


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3