css常用标签

css样式表cascading style sheet = CSS 层叠样式表
<style></style>  嵌入式样式表
<link type="text/css" href="css.css" rel="stylesheet" /> 引用式引用表
<p style="color:red;"> 内联式样式表
color:red;  颜色
font-size:20px; 字体大小
font-family:宋体; 字体
text-align:center; 文本对齐
boder-style 边框方式 如solid
border-width:2px;  边框宽度
border:solid 4px #f60;(实心粗体 4像素 颜色F60)  实例
border-left-color: 左边框颜色
border-left-style:  左边框样式
 botton  下
 top  上
 right  右
 left   左

width:20px; 指定宽度
height:20px; 指定高度
z-index
font-style:inherit; 字体方式
 italic;
 normal;
 oblique;
text-decoration:
 underline;
 none;
 overline;
text-transform:
 
background-color:#ccc;  背景颜色
默认px单位,可以是用em  cm
使用分号;结束
不用样式默认居左
优先级:标签中使用style排第一,head头部样式第二,link引用第三.
<div></div>
<p><spen></spen></p>
/*注释*/
@charset "utf-8";  编码方式
选择器
.css{color:red;}
#idname   id选择器
class="css"
vartical-align:top;
    sub;
    right;
    supe;
    botton;
    middle;
letter-spacing:10px;
white-space:
 normal;
 pre;
 nowrap;
a:hover{};   鼠标触摸到的时候


background-color /*背景颜色*/ #063;
background-image /*背景图片*/ url(o0.jpg)
background-repeat /*背景重复方式设置值*/ repeat-x;
background-position /*背景位置设置值*/
background-attachment /*固定或滚动背景设置值*/

table{table-layout:fixed;}
table{caption-side:bottom;}
table{boeder-collapse:collapse;}
table{border-spacing:}
table{empty-cells:}


float:left;  左对齐
margin 外边距
 auto自动 
padding 内边距
clear 清除漂浮元素

p:first-child{color:red;}

li:nth-child(2){color:red;} /*正序*/
li:nth-last-child{color:red} /*倒数*/
ever  偶数
odd 奇数
3n+1
3n
3n+2
2n+1
2n
2n+3

li:only-child{color:Red;}
p:child-of-type{color:red;}
p:last-of-type{color:red;}
p:nth-of-type{color:red;}


first-letter{color:red;}
first-letter-line{color:red;}

padding
/*如果有一个参数,就代表4个方向的内边距*/
/*如果有2个参数,第一个参数代表上下,第二个参数代表左右*/
/*如果有3个参数,第一个参数代表上,第二参数左右方向的值,第三个参数代表下方向的值*/
/*如果有4个参数,第一个参数代表上方向,第二个参数代表右方向,第三个代表下方向,第四个代表左方向(顺时针)*/


display:block;  /*转换成块级标签*/
display:inline;   /*转换成行级标签*/


cursor
 hand 手型
 pointer 手型
 crosshair 十字架
 text 文本效果
 wait 等待 
 default 默认
 help 问号
 e-resize 右
 ne 右上
 n 上
 nw 左上
 w 左
 sw 左下
 s 下
 se 右下
 auto 自动

 

  display:none;
  visibility:hidden;
  opacity:0.6;
 IE: filter:alpha(opacity=60);

posted @ 2013-09-30 15:42  reek  阅读(112)  评论(0)    收藏  举报