2020/5/22 JAVA HTML+CSS

1.三种定位方式:

  相对定位relative:相对于自身的位置进行偏移,postion需要搭配left/right/top/bottom

  postion:relative;

  left:10px;

  bottom:10px;

  绝对定位position:相对于有position属性的父元素定位,如果父元素没有position属性就会再向上找父元素,最后一张找到body元素

  固定定位fixed

2. 溢出div隐藏

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

  scroll内容溢出添加滚动条:overflow:;scroll;

  overflow:auto 是根据内容自动添加滚动条

3. 块状元素转内联元素

  block:块状;inline:内联元素;inline-block:内联块状的结合,可以设置宽高,不独占一行

  none:隐藏   display:

4.CSS3

  translate(x轴,y轴):移动

  transform:translate(20px,50px)

  rotate(顺时针旋转度数):旋转

  transform:rotate(200deg)

  scale(2,2):长、宽变大的倍数

  transition:transform 5s:过渡时间

  tran

猜你喜欢

转载自www.cnblogs.com/luzhijin/p/12938898.html