css选择器
1、通配符选择器
*{ margin: 0; padding: 0; }
2、标签选择器
a{ color: #515151; /* 让文本没有下划线 */ text-decoration: none; }
3、标签:hover 鼠标悬停(统称为伪类选择器),当鼠标在改标签上时,该标签字体颜色将会发生变化
a:hover{ color: lightblue; }
4、去除列表项前默认的圆点
li{ list-style-type: none; }
5、id是"#"(id选择器)class是"."(类选择器)
#mynav{ width: 100%; height: 50px; background-color: #947594; } .wmq{ color: red; font-size: 15px; }
6、样式发生层叠时,我们使用就近原则,后写的样式生效
.wmq{ color: red; font-size: 15px; } .wmq p{ color: blue; font-size: 30px; }
7、类选择器特点:
1).在css部分,.选择器的选择符是".";
2).在html部分,我在某个标签上,添加属性class="。
3).任何的标签都可以携带class属性。
4).class属性可以在多个标签上重复使用。
5).同一个标签,可能同时属刑多个类,用空格隔开
<div class="name w50 pd10"> <li> <a href="">html</a> </li> <li> <a href="">html5</a> </li> <li> <a href="">css</a> </li> </div>
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果