css1--样式表

css格式

选择器 {声明;声明;}

样式表分为3类,内联样式表,内部样式表,外部样式表

内联样式表:<p style="color:red;margin:10px;">ddddddd</P>

内部样式表:<style type="txt/css">    P {color:red;margin:10px;} </style>

外部样式表:<link rel="stylesheet" type="txt/css" href="head.css">

多重样式:样式的继承与覆盖。

例如,外部样式表拥有针对 h3 选择器的三个属性:

h3
{
color:red;
text-align:left;
font-size:8pt;
}

而内部样式表拥有针对 h3 选择器的两个属性:

h3
{
text-align:right;
font-size:20pt;
}

假如拥有内部样式表的这个页面同时与外部样式表链接,那么 h3 得到的样式是:

color:red;
text-align:right;
font-size:20pt;
posted @ 2016-08-17 17:41  火山林风  阅读(220)  评论(0)    收藏  举报