css定位和css3的基本

定位方式:position需要搭配left|right |top |bottom

1.相对定位:相对于自身的位置进行偏移position: relative;

2.绝对定位:相对于有position属性的父元素定位,如果父元素没有position属性就会再向上找父元素,最后- -直找到body元素 position: absolute;

3.固定定位 position: fixed;--------------相对body

隐藏:

1.hidden内容溢出div就隐藏---------overflow: hidden; 

2.scroIl内容溢出添加滚动条----------overflow:scroll;

块状元素和内联元素

1.block:块状; inline:内联元素; inline -block:内联块状的结合

2.inline-block:可以设置宽高,不独占-行------none :隐藏

css3的基本参数

1.border-radius:(四个角度)

2.2,3D动态效果

.d1:hover{
         /* translate(沿着x,y轴旋转)*/
         /* transform: translate(20px,50px);*/
          /* 旋转*/
         /* transform: rotate(200deg);*/
         /* 放大*/
        transform: scale(2,3);
         /* 过渡*/
       transition: transform 5s;

猜你喜欢

转载自www.cnblogs.com/haoduoyu0512/p/12939261.html
今日推荐