会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133331个问题
WEB前端全系列/第一阶段:HTML5+CSS3模块/商城官网项目 392楼

<!DOCTYPE html>

<html lang="zh-CN">


<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <div class="dw">

        <style>

            * {

                margin: 0;

                padding: 0;

            }


            .dw {

                width: 800px;

                height: 120px;

                background-color: #ababab;

               

            }


            .dw22 {

                width: 800px;

                height: 100px;

                background-color: #6de9c6;


            }


            .wda {

                width: 80px;

                height: 80px;

                background-color: red;

                margin-left: 10px;

                margin-top: 20px;

                float: left;

            }

        </style>

    </div>

</head>


<body>

    <div class="dw22">

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

        <div class="wda"></div>

    </div>

    <div class="dw">

    </div>

</body>


</html>


//为啥这个dw是异常的,在所有div后面,也不是左上角对齐,而生内部居中

WEB前端全系列/第一阶段:HTML5+CSS3模块/初识CSS 393楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS常用属性 395楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/初识CSS 396楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS常用属性 397楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 398楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/前端入门与基础知识 401楼

<style>
        .container{
            width: 1400px;
            height: 1400px;
            margin: 0 auto;
            background-color: brown;
        }
        .header{
            height:80px;
            background-color: antiquewhite;
        }
        .nav{
            height:80px;
            margin-top: 10px;
            background-color: antiquewhite;
        }
        .main{
            height:80px;
            margin-top: 10px;
        }
        .left{
            float: left;
            width: 900px;
            height: 600px;
            background-color: bisque;
        }
        .right{
            float: right;
            width: 480px;
            height: 600px;
            background-color: antiquewhite;
        }
        .footer{
            height: 80px;
            margin-top: 10px;
            background-color: bisque;
        }
        
 </style>
 <body>
   
    <div class="container">
        <div class="header">网站头部</div>
        <div class="nav">网站导航</div>
        <div class="main">
            <div class="left">主要内容</div>
            <div class="right">侧边栏</div>
        </div>
        <div class="footer">网站底部</div>

    </div>
</body>
跟着老师敲的代码,怎么运行出来最后一个footer容器怎么是这样显示的

image.png

WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5新增元素 402楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS常用属性 403楼

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <link rel="stylesheet" href="./grid.css">

    <style>

        *{

            margin: 0;

            padding: 0;

        }

        .col {

            padding-top: 10px;

            padding-bottom: 10px;

            background-color: rgba(86,61,124,0.15);

            border: 1px solid rgba(86,61,124,0.2);

        }

    </style>

</head>

<body>

    <div class="container">

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>

        <div class="col col-xs-12 col-sm-6 col-md-2 col-lg-1">盒子</div>    

    </div>

</body>

</html>

老师我这里的代码打上去之后,不管怎么修改界面都是一行一个格子,我弄了好久都没有找到问题

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 404楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637