html - 为什么 CSS 控制不了第二个DIV ?
本文介绍了html - 为什么 CSS 控制不了第二个DIV ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
.main {
width: 1440px;
height: 4694px;
}
.sort-box {
width: 100%;
height: 90px;
background-color: aqua;
}
.3Dimg_box {
width: 1220px;
height: 500px;
background-color: #6495ED;
}
</style>
<body>
<div class="main">
<div class="sort-box">
</div>
<div class="3Dimg_box">
<a href="">这个DIV的CSS怎么没效果</a>
</div>
</div>
</body>
</html>
解决方案
这个是CSS类命名问题:不能以数字开头命名CSS类
改成threeDimg_box就可以了
这篇关于html - 为什么 CSS 控制不了第二个DIV ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文