为什么 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>
阅读 3.2k
3 个回答

这个是CSS类命名问题:不能以数字开头命名CSS类
改成threeDimg_box就可以了
CSS类命名

类以数字开头...没法玩...

类名的第一个字符不能使用数字

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题