CSS
<link rel="stylesheet" href="./css/1.css">
CSS选择器
/* 标签名选择器:所有该名字的标签都会获取此样式 /
a,div{
width: 100px;
height: 100px;
background-color: chartreuse;
}
/ ID选择器:通过ID来进行选择 /
/ 通过标签的ID来选择,但是一个ID只会对应一个标签
该方法时对标签进行精准控制
*/
#id1{
width: 100px;
height: 100px;
background-color: coral;
}
/* 类选择器:把多个东西归为一类 */
.c1{
width: 100px;
height: 100px;
background-color: darkmagenta;
}
/* 派生选择器 */
#id .c1{
width: 100px;
height: 100px;
background-color: honeydew;
}
来源:CSDN
作者:许润清
链接:https://blog.csdn.net/weixin_42174516/article/details/103928115