<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>

/*全局设置,外边距*/
*{
margin: 0px;
padding: 0px;
}

/*id选择器*/
#d1{
width: 300px;
height: 200px;
background-color: greenyellow;
}

/*class选择器*/
.d3{
width: 300px;
height: 200px;
background-color: lightseagreen;
}

/*标签选择器*/
div{
border: solid black 5px;
}

/*不常用选择器*/
[name=N1]{
width: 300PX;
height: 100PX;
background-color: red;
}

/*并列选择器*/
.d4,.d5{
width: 300px;
height: 200px;
background-color: hotpink;
}

/*单独改字体,并不改其他的字体*/
.c6 span{
color: red;
width: 300px;
height: 200px;
}

/*并列选择器*/
.x1{
width: 300px;
}
.x2{
height: 200px;
}
</style>

 


<link type="text/css" rel="stylesheet" href="css/sdtyle1.css"/>
</head>

<body>
<!--第一种直接写--> <!--但是这种方式是最后用的-->
<div style="width: 300px; height: 200px; background-color: red;">这是第一种选择器</div>


<!--第二种用选择器-->
<div ></div>

<!--(敲黑板)优先级的问题,总的来说后面的代码优先级高-->

</body>
</html>

以上就是我学习和整理的内容,希望看到的同学对里面错误和不合适的地方进行指正,谢谢。

                                                                                             ~~明天,又是充满希望的一天。

相关文章:

  • 2022-02-10
  • 2021-06-23
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-07-26
  • 2022-12-23
猜你喜欢
  • 2022-02-15
  • 2021-12-26
  • 2021-05-22
  • 2022-12-23
  • 2021-07-04
  • 2021-07-10
  • 2022-03-01
相关资源
相似解决方案