CSS
CSS3就是css语言,数字3是该语言的版本号;css语言开发的文件是以.css为后缀,通过在html文件中引入该css文件来控制html代码的样式(css语言代码也可以直接写在html文件中),采用的语言是级联样式表 (Cascading Style Sheet),也属于标记语言。用来完成页面样式与布局
css三种引入方式
css的引入h2 {
color: red;
font-size: 100px;
text-align: center;
}
css的引入
h1标签
h2标签
h2标签
h3标签
h3标签
h4标签
h4标签
------------------------------------------------------------------------------
/* css/样式引入.css */
h3 {
color: green;
}
h4 {
font-size: 50px;
text-align: center;
}
三种css引入直接的优先级
css的引入\h3标签
h3标签
h4标签
h4标签
h4 {
color: #ff7800;
font-size: 20px;
}
css基础选择器
css基础选择器/*优先级:可以从作用范围来判断 - 作用范围越精确,优先级越高 */
/*1、统配选择器*/
* {
color: pink;
font-size: 12px;
}
/*2、标签选择器*/
h1 {
font-size: 20px;
}
/*3、类选择器*/
.h {
font-size: 30px!important;
}
.h2 {
font-size: 40px;
}
.h.h2 {
font-size: 50px;
}
/*4、id选择器*/
#hhh {
font-size: 100px;
}
1标题
2标题
优先级:!important > 行间式 > id > class > 标签 > 统配,作用范围越精确,优先级越高