《css设计指南》 读书笔记 二

  1. margin、padding的属性值顺序均为 上右下左
  2. 垂直方向上的margin外边距会叠加,取较大值。水平方向则不会,两者之间间距为两者之间margin外间距之和。
  3. 围住浮动元素的三种方法: 一:为父元素添加overflow:hidden   二:同时浮动父元素   三:添加非浮动的清除元素(写一个class,里面包含clear属性)
  4. 图片背景居中可以通过把background-position设为50%,50%,把background-repeat设为no-repeat实现了图片在背景区间内居中的效果。
  5. 背景粘附: background-attachment属性控制滚动元素内的背景图片是否随元素滚动而移动。值有scroll和fixed。
  6. css3新增背景属性:background-clip,background-origin,background-break。
  7. 多背景图片:background:url(a.png) 30px -10px no-repeat , url(b.png) 40px 0px no-repeat , url(c.png) 0px -10px no-repeat , #ffbd75 ;
  8. 背景渐变:background: linear-gradient( #ffffff , #e86a43 25% );
  9. 放射性背景渐变:background: -webkit-radial-gradient( 50px 30px , circle, #ffffff , #e86a43 , #111111 );
  10. 继续更新中》》》》
原文地址:https://www.cnblogs.com/neuscx/p/5140401.html