小记

①image-set

  .cnt{

    background-image: url(../img/x.png);

    background: -webkit-image-set(

      url(../img/1x.png) 1x,

      url(../img/2x.png) 2X,

      url(.../img/3X.png) 3X;

    );

  }

 

② word-break: break-all; 单词折断换行

  word-wrap: break-word; 整个单词换行

 

③计算图片加载时间

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>img-load</title>
</head>
<body>
<img src="https://www.baidu.com/img/bd_logo1.png">

<script type="text/javascript">
var measure_start = performance.now();
document.getElementsByTagName("img")[0].addEventListener("load", function(){
var measure_end = performance.now();
console.log("image load time:" + (measure_end - measure_start));
},false);
</script>

</body>
</html>

 

④scrollbar

 

posted @ 2015-11-11 16:48  lynnDu  阅读(140)  评论(0编辑  收藏  举报