css样式的优先级
来源:互联网 发布:数据比例图 编辑:程序博客网 时间:2024/05/17 02:13
1. 内联样式表的权值最高 1000;
2. ID 选择器的权值为 100
3. Class 类选择器的权值为 10
4. HTML 标签选择器的权值为 1
For example:
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8" />
<title> </title>
<meta name="author" content="" />
<style type="text/css">
#a{
font-size:12px;
}
div p{
font-size:13px;
}
div .c{
font-size:14px;
}
.a .b .c{
font-size:15px;
}
#b{
font-size:16px;
}
</style>
</head>
<body>
<div id="a" class="a">
<div id="b" class="b">
<p id="c" class="c">I am here.</p>
</div>
</div>
</body>
</html>
0 0
- CSS样式的优先级...
- CSS样式的优先级
- CSS样式的优先级
- CSS样式的优先级
- css样式的优先级
- css样式的优先级
- css样式的优先级
- CSS 样式的优先级
- css样式的优先级
- CSS样式的优先级
- css样式的优先级
- CSS样式的优先级
- CSS样式的优先级
- CSS样式表的优先级
- CSS样式的优先级问题
- CSS样式的优先级问题
- CSS中样式的优先级
- css的样式选择优先级
- C++中 模板Template的使用
- 22:24 2016/6/9 PHP基础练习题与答案详解
- 106. Construct Binary Tree from Inorder and Postorder Traversal
- java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
- string函数用法详解
- css样式的优先级
- 自定义Toast
- MySQL 事务没有提交导致锁等待
- 迭代器
- 列表生成式
- 线程池
- 《C++语言基础》程序阅读——指针、const、static(一)
- C++ sizeof关键字的使用总结
- 粗浅看 Tomcat系统架构分析