链接伪类选择器
a:link {
color: #333;
text-decoration: none;
}
a:visited {
color: purple;
}
a:hover {
color: #f40;
}
a:active {
color: green;
}
但是实际开发,我们这样写就够了~~~~
a {
color: #333;
text-decoration: none;
}
a:hover {
color: #f40;
}
属性选择器
属性选择器: 根据元素的属性来选择器元素
比如:把禁用按钮鼠标样式改为禁用
/* 必须是button这类元素 同时这个button必须带有disabled属性 */
button[disabled] {
cursor: not-allowed;
}
<button>+</button>
<button disabled>-</button>
权重: 类、伪类、属性选择器 都是 10
可以根据属性值来选择 不同的元素
input[type=submit] {
color: red;
}
这样只选择提交按钮
<input type="reset" value="重置"><input type="submit" value="提交">