前端之CSS(持续更新)

/*注释*/

元素选择器
div {color:red;}

id选择器
#idnum{color:red;}

class选择器
.classstr{color:red;}

子元素选择器
.classstr #p{color:red;}
.classstr p{color:yellowgreen;}

相邻元素选择器
.classstr+div {color:yellowgreen;}

群组选择器
.classstr,div {color:yellowgreen;}

字体样式
.classstr{
font-family:宋体;
font-size:20px;
color:red;
font-weight:400;
font-style:italic;
}

文本样式
#idnum{
text-decoration:none;
text-indent:28px;
text-align:center;
}

边框样式
.classstr1{
border-width:1px;
border-style:solid;
border-color:red;
}

背景样式
.classstr1{
background-color:aliceblue;
}

超链接样式
a{text-decoration:none;}/*留此样式1*/
a:link { color:white;}
a:visited{color:purple}
a:hover{color:yellow;text-decoration:underline;}/*留此样式2*/
a:active{color:red;}

列表样式
.classstr{
list-style-type:none;
}

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注