会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 134361个问题

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>魅族</title>
    <style>
        .box-header{
            width: 100%;
            height: 680px;
            background: url("魅族images/444c6b0f-a71c-4e91-8c17-6745223228c5.jpg") no-repeat center ;
            background-size: cover;
        }
        .box-phone{
            width: 100%;
            height: 450px;
            background: url("魅族images/a6c64f8f-6ab5-4a93-8139-2a893eb2a2a5.jpg") no-repeat center;
            background-size: cover;
        }
        .box-header-bottom{
            width: 1262px;
            height: 277px;
            /*background: red;*/
        }
        .box-top{
            width: 25%;
            height: 100%;
            /*background: orange;*/
            float: left;
        }
        .img1{
            width: 130px;
            height: 130px;
        }
        .box-top>p:first-of-type,.phone-top-left>p:first-of-type,.phone-top-right>p:first-of-type,.phone-bottom-items>p:first-of-type{
            font-size: 20px;
            font-weight: bold;
            width: 310px;
            height: 30px;
        }
        .box-top>p:last-child,.phone-top-left>p:first-of-type+p,.phone-top-right>p:first-of-type+p,.phone-bottom-items>p:last-of-type{
            color: #999999;
            font-size: 14px;
            width: 310px;
            height: 21px;
        }
        .title{
            text-align: center;
            font-weight: bold;
            font-size: 2em;
        }
        .box-phone-bottom{
            width: 1262px;
            height: 1005px;
        }
        .box-phone-bottom-center{
            width: 1230px;
            height:1220px;
        }
        .phone-top{
            width:1230px;
            height: 610px;
        }
        .phone-bottom{
            width: 1212px;
            height: 375px;
        }
        .phone-top-left,.phone-top-right{
            width: 615px;
            height: 610px;
            float: left;
        }
        .phone-bottom-items{
            width: 303px;
            height: 375px;
            float: left;
        }
        .img2{
            width: 460px;
            height: 460px;
        }
        .price{
            width: 71px;
            height: 33px;
            color: red;
            font-size: 28px;
        }
        .price1{
            width: 14px;
            height: 21px;
            font-size: 12px
        }
        .img3{
         width: 230px;
            height: 230px;
        }
/*.img+p{
    font-size: 20px;
    font-weight: bold;
}*/
    </style>
</head>
<body>
<div class="box-header">
    <a href="https://www.meizu.com/">
    </a>
</div>
<div class="box-header-bottom">
    <div class="box-top" align="center">
        <img src="魅族images/5f896683-d2f2-487d-a296-722fc9e17f1e.png" alt="" class="img1">
        <p>魅族 18</p>
        <p>立省900 + 12 期免息 + 赠手机壳</p>
    </div>
    <div class="box-top" align="center">
        <img src="魅族images/5f896683-d2f2-487d-a296-722fc9e17f1e.png" alt="" class="img1">
        <p>魅族 18</p>
        <p>立省900 + 12 期免息 + 赠手机壳</p>
    </div>
    <div class="box-top" align="center">
        <img src="魅族images/5f896683-d2f2-487d-a296-722fc9e17f1e.png" alt="" class="img1">
        <p>魅族 18</p>
        <p>立省900 + 12 期免息 + 赠手机壳</p>
    </div>
    <div class="box-top" align="center">
        <img src="魅族images/5f896683-d2f2-487d-a296-722fc9e17f1e.png" alt="" class="img1">
        <p>魅族 18</p>
        <p>立省900 + 12 期免息 + 赠手机壳</p>
    </div>
</div>
<h3 class="title">手机</h3>
<div class="box-phone">
</div>
<div class="box-phone-bottom">
    <div class="box-phone-bottom-center">
        <div class="phone-top" >
            <div class="phone-top-left" align="center">
                <p>魅族 18</p>
                <p>限时领券至高立省900 | 赠手机壳</p>
                <p class="price"><span class="price1">¥</span>3999</p>
                <img src="魅族images/de87d38d-3785-4605-a211-71364ded123f.png" alt=""  class="img2">
            </div>
            <div class="phone-top-right" align="center">
                <p>魅族 18</p>
                <p>限时领券至高立省900 | 赠手机壳</p>
                <p class="price"><span class="price1">¥</span>3999</p>
                <img src="魅族images/de87d38d-3785-4605-a211-71364ded123f.png" alt=""  class="img2">
            </div>
        </div>
        <div class="phone-bottom">
            <div class="phone-bottom-items" align="center">
                <img src="魅族images/Cgbj0F6zwMuANEeWAAw6yQFAJXM097.png" alt="" class="img3">
                <p>魅族 17「AG梦幻独角兽」</p>
                <p>高通骁龙 865 | 120 Hz尝鲜模式</p>
                <p class="price"><span class="price1">¥</span> 3699</p>
            </div>
            <div class="phone-bottom-items" align="center">
                <img src="魅族images/Cgbj0F6zwMuANEeWAAw6yQFAJXM097.png" alt="" class="img3">
                <p>魅族 17「AG梦幻独角兽」</p>
                <p>高通骁龙 865 | 120 Hz尝鲜模式</p>
                <p class="price"><span class="price1">¥</span>3699</p>
            </div>
            <div class="phone-bottom-items" align="center">
                <img src="魅族images/Cgbj0F6zwMuANEeWAAw6yQFAJXM097.png" alt="" class="img3">
                <p>魅族 17「AG梦幻独角兽」</p>
                <p>高通骁龙 865 | 120 Hz尝鲜模式</p>
                <p class="price"><span class="price1">¥</span> 3699</p>
            </div>
            <div class="phone-bottom-items" align="center">
                <img src="魅族images/Cgbj0F6zwMuANEeWAAw6yQFAJXM097.png" alt="" class="img3">
                <p>魅族 17「AG梦幻独角兽」</p>
                <p>高通骁龙 865 | 120 Hz尝鲜模式</p>
                <p class="price"><span class="price1">¥</span> 3699</p>
            </div>
        </div>
    </div>
</div>
</body>
</html>

老师,我写魅族官网写了一部分,为什么价格哪里class都一样,但是设置不出来同样的样式呢?

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS常用属性 391楼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>金立手机官网—金立手机及配件官方正品专卖网站_金立全面全面屏s11新品首发</title>
    <link rel="icon" href="https://shop.gionee.com/favicon.ico">
    <link rel="stylesheet" href="css/jinli.css">
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
    </style>
</head>
<body>
<div class="nav">
    <div class="wrap">
        <div class="logo">
            <img src="image/logo.png" alt="">
        </div>
        <div class="nav_right">
            <div class="enter">
                <ul>
                    <li><a href="#">amigo账号登录</a><span>|</span></li>
                    <li><a href="#">原账号登录</a><span>|</span></li>
                    <li><a href="#">注册</a></li>
                    <li><a href="#">购物车(0)</a></li>
                </ul>
            </div>
            <div class="phone">
                <ul>
                    <li><a href="#">首页</a></li>
                    <li><a href="#">手机</a></li>
                    <li><a href="#">配件</a></li>
                    <li><a href="#">服务</a></li>
                    <li><a href="#">下载</a></li>
                    <li><a href="#">amigoOS</a></li>
                    <li class="search" >
                        <input type="text" placeholder="请输入搜索内容" autofocus>
                        <button>搜</button>
                    </li>
                </ul>

            </div>
        </div>
    </div>

</div>
</body>
</html>
.nav{
    width: 100%;
    height: 104px;
    border-bottom: 1px solid #d5d5d5;
    position: fixed;
    left: 0px;
    top: 0px;
    /*background-color: #cc0000;*/
}
.wrap{
    width: 1084px;
    height: 104px;
    margin: 0px auto;
    /*background-color: #42c3ee;*/
}
.logo img{
    width: 205px;
    margin-top: 25px;
}
.logo,.nav_right{
    float: left;
}
.nav_right{
    width:879px;
    height: 104px;
}
.enter{
    width: 100%;
    height: 30px;
    line-height: 30px;
}
.enter ul li a{
    text-decoration: none;
}
.enter ul li a:hover{
    color: #ef4222;
}
.enter ul li{
   list-style-type: none;
}
.nav_right ul{
    float: right;
}
.nav_right ul li{
    float: left;
}
.nav_right ul a{
    margin:0px 10px;
    color: #9f9f9f;
}
.enter ul li:first-child a{
    color:#ef4222 ;
}
.phone{
    width:100%;
    height: 73px;
    line-height: 73px;
}
.phone ul li a{
    text-decoration: none;
}
.phone ul li{
    list-style-type: none;
}
.phone ul li a{
    margin-left: 40px;
    font-size: 16px;
    color: black;
    /*font-weight: bolder;*/
}
.phone ul li a:hover{
    color: #ef4222;
}
.search{
    width: 170px;
    height: 30px;
    /*border: 1px solid #fff;*/
    box-sizing: border-box;
    /*padding-left: 5px;*/
    margin-top:18.5px;
    margin-left: 120px;

}
.search input{
    width: 138px;
    height: 28px;
    float: left;
}
.search button{
    width: 25px;
    height: 28px;
    float: left;
    background-color: #ffff;
    border: none;
}

blob.png

老师我的搜索按钮怎么不在这个框里面呀blob.png

WEB前端全系列/第一阶段:HTML5+CSS3模块/前端入门与基础知识 392楼

<!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>
</head>

<body>
    <table border="1" height="500" width="700">
        <tr bgcolor="pink">
            <td rowspan="2" align="center">酒店</td>
            <td align="center">海外酒店</td>
            <td align="center">团购</td>
        </tr>
        <tr bgcolor="pink">
            <td align="center">特价酒店</td>
            <td align="center">民宿.客栈</td>
        </tr>
        <tr bgcolor="blue">
            <td align="center" rowspan="2">机票</td>
            <td align="center">火车票.抢票</td>
            <td align="center">汽车票.船票</td>
        </tr>
        <tr bgcolor="blue">
            <td align="center"> 特价机票</td>
            <td align="center">专车.租车</td>
        </tr>
        <tr bgcolor="green">
            <td align="center" rowspan="2">旅游</td>
            <td align="center">目的地攻略</td>
            <td align="center">游轮旅游</td>
        </tr>
        <tr bgcolor="green">
            <td align="center">周边游</td>
            <td align="center">定制旅游</td>
        </tr>
        <tr bgcolor="orange">
            <td align="center">景点.玩乐</td>
            <td align="center">美食林</td>
            <td align="center">购物.外汇</td>
        </tr>
        <tr bgcolor="orange">
            <td align="center">礼品卡</td>
            <td align="center">WIFI电话卡</td>
            <td align="center">保险.签证</td>
        </tr>
    </table>
</body>

</html>


KLGQGWHJR_9LOI]6{9GWK7J.png



W90E}4EDIG4B3TET2Y)]6~X.png

老师我想问下这图片是怎么加进去的呀,如果加进去后文字的位置会怎么样呢?







WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5基础元素 394楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS选择器 395楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/商城官网项目 403楼

<!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 404楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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