1.在写一个div的时候,最外部的div的样式可以起作用,可是向下嵌套一层div的时候,css不会对这个div起作用,
说明这个样式是被引入了.
2.以下是代码
html:`<div id="nav_s">
<span class="loggg">asdasdasdsad</span>
</div>`
css:`#nav_s {
position: fixed;
top: 0;
width: 100%;
z-index: 100;
width: 100%;
height: 100px;
background-color: black;
color: white;
};
.loggg {
color: red;
width: 500px;
height: 500px;
background-color: red;
}`
你说的没有起作用;是说span吧,换成display:block;
<!DOCTYPE html>
<html>
</html>