html css相对单位

p{
background:grey;
color:white;
font-size:0.5in;
height:2em;

width:50%;
}

 

height:2em意思就是屏幕上显示的的高度为字号的2倍

font-size:0.5in;就是html的字号设置为0.5英寸,是绝对值

width:50% 宽度为浏览器的0.5

 

 

 css相对长度也可以更为灵活的使用,比如width:calc(80% - 20px);

 

css角度的使用

.image_test_1, .image_test_5 {
-moz-transform: rotate(-5deg);
-webkit-transform: rotate(-5deg);
-o-transform: rotate(-5deg);
transform: rotate(-5deg);

/*

 -o-transform: /* Opera浏览器 */

  -webkit-transform:  /* Webkit内核浏览器 */

  -moz-transform: /* Firefox浏览器 */

*/
}
posted @ 2016-06-12 11:20  新年新气象  阅读(327)  评论(0编辑  收藏  举报