您的位置:首页 > Web前端 > CSS

CSS的各种属性

2016-03-30 10:24 447 查看
    CSS的各种属性:

      CSS的单位:
a. 绝对单位 1in=2.54cm=25.4mm=72pt=6pc , pt是点或者磅,pc是派卡
b. 相对单位:px, em(印刷单位相当于12个点), %(相对周围的文字)

*字体设置
  p{
font-size:50px;    /*字体大小*/
font-style:italic ;  /*斜体*/
font-weight:bold;  /*粗体*/
font-family:幼圆;  /*字体类型*/
font-variant:small-caps;  /*小写变大写*/
}
*文本设置
  p{
letter-spacing:0.5cm ; /*字母间距*/
word-spacing:1cm;   /*单词间距*/
text-align:center;   /*在所包含容器的中间*/
text-decoration:overline; /*字体修饰 underline下划线 line-through中划线 overline上划线*/
text-transform:lowercase;  /*单词字体大小写*/
color:red ;
}

*背景设置
body{
background-color:#ff99ff ;  /*背景颜色*/
background-image:url(images/2.gif) ; /*背景图片*/
background-repeat: no-repeat;  /*no-repeat不要平铺,repeat-x,横向平铺,repeat-y 纵向平铺*/
background-position:center right; /*背景位置*/
background-attachment: scroll ;           /*背景的移动 ,fixed跟着滚动条一起移动,scroll 不动*/
}
*列表设置
ul li{
list-style:none;    /*列表前样式*/
list-style-image:url(images/2.gif) ;  /*列表项前图片*/
margin-left:80px;  
}

*盒子模型(border margin padding)
padding:是内容到边的距离
border: 是边的粗细
margin:是控件到控件的距离
 
*定位设置(position,float,clear,z-index)
#d{
position: absolute;    /*
 1.绝对定位: 定义横纵坐标 .脱离了本身的顺序流
 2.相对定位: 相对的是自己在顺序流中原来的位置
 */

left:100px;    /*横坐标*/
top:100px;     /*纵坐标*/
border:1px solid red ;  
width:100px;
height:100px;
background-color:#ff66ff;
 }

#d1{
position: relative;    /*相对位置*/
left:100px;
top:100px;
border:1px solid green ;
width:100px;
height:100px;
background-color:#339900;
 }

span{
position: relative;
left:20px;
top:20px;
}

           z-index:值任意,值越大离我们越近
  float : 浮动
  overflow: 超出范围怎么办

           鼠标样式设置(cursor)

        最近特别特别的喜欢林俊杰的歌,耳朵要怀孕。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  css