css 样式表 基础 样式

1大小

  width  宽度

  height 高度

2 背景

  background-color 背景色

  background-image:url(图片位置) 背景图片

  background-repeat;  背景图片的平铺方式

  background-position  背景图片的位置

  background-attachment  设置背景图片是否滚动

  background-sizi  设置图片大小

3字体

  font-family 字体样式

  font-sizi 字体大小12px-16px

  font-style :italic倾斜

  font-weight :bold  加粗

  text-decoration  :underline  下划线

  color   颜色

4 对齐方式

  text-align  水平对齐

  vertical-align垂直对齐配合display:table-cell

  line-height 行高

  text-indent 缩进单位字符

5边界边框

  magin  外边距

  padding  内边距  上又下左  默认为0   加内边距会变大

  border  边框   3个要素  粗细 样式颜色

6 列表方块

  list-style : none 将列表前面的序号去掉

  list-style-image:   可以将前面的序号换成图片

7 其他

  隐藏(用户看不到,不占位置):            diaplay:none;

  显示(用户能看到):         display:block;

  div宽度等于文字宽度:       display:inline-block;

  z-index分层:                     z-index:5555;                  (数值越大的,越靠上)

  opacity:0.5;  -moz-opacity:0.5;   filter:alpha(opacity=50)  数值越小,透明度越大

  border-radius:5px;   圆角

  box-shadow:0 0 5px white;   阴影

 

8 定位

相对定位(占位置):position:relative;使元素作为常规元素出现,并且使position:absolute;在其中定位。用top/bottom/left/right来改变位置时,占据其他元素位置。

绝对定位(不占位置):position:absolute;单独使用后浮动,top/bottom/left/right来改变位置时,不占据其他元素位置。

固定在浏览器某个位置:position:fixed;

 

posted @ 2017-04-03 09:16  v587yy  阅读(256)  评论(0编辑  收藏  举报