css属性设置

时间:2023-03-10 04:35:57
css属性设置

css在线编辑工具地址:http://tool.chinaz.com/Tools/CssDesigner.aspx

案例详情: http://dongtianee.sinaapp.com/index.html

position属性

  • static:无特殊定位,对象遵循正常文档流。toprightbottomleft等属性不会被应用,默认值。
  • relative:对象遵循正常文档流,但将依据toprightbottomleft等属性在正常文档流中偏移位置。
  • absolute:对象脱离正常文档流,使用toprightbottomleft等属性进行绝对定位。而其层叠通过z-index属性定义。
  • fixed:对象脱离正常文档流,使用toprightbottomleft等属性以窗口为参考点进行定位,当出现滚动条时,对象不会随着滚动。(IE6不支持此属性)

 水平居中

  1、margin:0 auto;(0可以换成随意数字)
  2、margin-top:auto;margin-bottom:auto;height:200px;

 垂直居中

    1、vertical-align:middle;
  2、margin-left:auto;margin-right:auto;

 阴影:

  -moz-box-shadow: 0.3em 0.4em 0.3em #898989;
  box-shadow: 0.3em 0.4em 0.3em #B6B6B6;

 行距:

  line-height : 180%;

内容可选性:

  -webkit-user-select: none;

  user-select: none;