css——完整网页

目标样式:
在这里插入图片描述
第一步设置基本边框
观察整个网页布局,在此基础上安排好框架
在这里插入图片描述代码:

<html>
    <head>
        <title>万豪</title>
        <style type="text/css">
        /*设置整个网页的大小*/
            .over{
                width:800px;
                height: 1000px;
                border: brown solid 1px;
                margin: 0px auto 0px auto;
            }
            /*头部*/
            .header{
                width:798px;
                height: 100px;
                border: brown solid 1px;
                margin: 0px 0px 0px 0px;
            }
            /*菜单栏*/
            .caidan{
                width:798px;
                height: 30px;
                border: brown solid 1px;
                margin: 0px 0px 0px 0px;
            }
            /*身体部分*/
            .bodyer{
                width:798px;
                height: 750px;
                border: brown solid 1px;
                margin: 0px 0px 0px 0px;
            }
            /*身体分成左右两部分*/
            /*L为左部分*/
            .b-L{
                width:500px;
                height: 750px;
                border: rgb(11, 219, 133) solid 1px;
                float: left;
            }
            /*左部分中的上*/
            .b-L-up{
                width:500px;
                height: 250px;
                border:  rgb(81, 25, 185) solid 1px;
             
            }
            .zi{
                width:500px;
                height: 40px;
                border: rgb(228, 25, 211) solid 1px;
            }
            .tupian{
                width:500px;
                height: 205px;
                border:rgb(228, 25, 211) solid 1px;
            }
            /*左部分中的中间*/
            .b-L-min{
                width:500px;
                height: 250px;
                border: rgb(81, 25, 185) solid 1px;
             
            }
            .min-L{
                width:280px;
                height: 250px;
                border: rgb(228, 25, 211) solid 1px;
                float: left;
            }
            .min-L-tu{
                width:280px;
                height: 230px;
                border: rgb(10, 213, 228) solid 1px;
                
            }
            .min-L-zi{
                width:280px;
                height: 18px;
                border: rgb(10, 213, 228) solid 1px;
                
            }
            .min-R{
                width:210px;
                height: 250px;
                border: rgb(228, 25, 211) solid 1px;
                float: right;
            }
            .min-R-tu{
                width:210px;
                height: 40px;
                border: rgb(10, 213, 228) solid 1px;
                
            }
            .min-R-zi{
                width:210px;
                height: 205px;
                border: rgb(10, 213, 228) solid 1px;
                
            }
            /*左部分的下*/
            .b-L-foot{
                width:500px;
                height: 245px;
                border: rgb(81, 25, 185) solid 1px;
             
            }
            .L-up{
                width:500px;
                height: 25px;
                border:rgb(10, 213, 228) solid 1px;
            }
            .L-up-L{
                width:40px;
                height: 25px;
                border:rgb(10, 213, 228) solid 1px;
                float: left;
            }
            .L-up-R{
                width:40px;
                height: 25px;
                border:rgb(10, 213, 228) solid 1px;
                float: right;
            }
            .L-foot{
                width:500px;
                height: 220px;
                border:rgb(10, 213, 228) solid 1px;
            }
            .L-foot-b1{
                width:245px;
                height: 110px;
                border:rgb(10, 213, 228) solid 1px;
                float: left;
            }
            .L-foot-b2{
                width:245px;
                height: 110px;
                border:rgb(10, 213, 228) solid 1px;
                float: right;
            }
            .L-foot-b3{
                width:245px;
                height: 100px;
                border:rgb(10, 213, 228) solid 1px;
                float: left;
            }
            .L-foot-b4{
                width:245px;
                height: 100px;
                border:rgb(10, 213, 228) solid 1px;
                float: right;
            }
            /*右部分*/
            .b-R{
                width:290px;
                height: 750px;
                border: rgb(11, 219, 133) solid 1px;
                float: right;
            }
            /*右部分的上*/
            .b-R-up{
                width:290px;
                height: 150px;
                border: rgb(81, 25, 185) solid 1px;
                
            }
            .R-up-tu{
                width:290px;
                height: 30px;
                border: rgb(81, 25, 185) solid 1px;
                
            }
            .R-up-xu{
                width:290px;
                height: 90px;
                border: rgb(81, 25, 185) solid 1px;
                
            }
            .R-up-zi{
                width:290px;
                height: 24px;
                border: rgb(81, 25, 185) solid 1px;
                
            }
           
            /*右部分的下*/
            .b-R-foot{
                width:290px;
                height: 200px;
                border: rgb(81, 25, 185) solid 1px;
                
            }
             .R-foot-tu{
                width:290px;
                height: 30px;
                border: rgb(81, 25, 185) solid 1px;
                
            }
            .R-foot-zi{
                width:220px;
                height: 30px;
                border: rgb(81, 25, 185) solid 1px;
                margin: 0px auto 0px auto;
                
            }
            .R-foot-an{
                width:190px;
                height: 130px;
                border: rgb(81, 25, 185) solid 1px;
                margin: 0px auto 0px auto;
                
            }
            .footer{
                width:798px;
                height: 100px;
                border: brown solid 1px;
                margin: 0px 0px 0px 0px;
            }
        </style>
    </head>
    <body>
        <div class="over">
            <div class="header">

            </div>

            <div class="caidan">

            </div>

            <div class="bodyer">
                <div class="b-L">
                    <div class="b-L-up">
                        <div class="zi">

                        </div>
                        <div class="tupian">

                        </div>
                    </div>
                    <div class="b-L-min">
                        <div class="min-L">
                            <div class="min-L-tu"></div>
                            <div class="min-L-zi"></div>
                        </div>
                        <div class="min-R">
                            <div class="min-R-tu"></div>
                            <div class="min-R-zi"></div>
                        </div>
                    </div>
                    <div class="b-L-foot">
                        <div class="L-up">
                            <div class="L-up-L"></div>
                            <div class="L-up-R"></div>
                        </div>
                        <div class="L-foot">
                            <div class="L-foot-b1"></div>
                            <div class="L-foot-b2"></div>
                            <div class="L-foot-b3"></div>
                            <div class="L-foot-b4"></div>
                        </div>
                    </div>
                </div>

                <div class="b-R">
                    <div class="b-R-up">
                        <div class="R-up-tu"></div>
                        <div class="R-up-xu"></div>
                        <div class="R-up-zi"></div>
                    </div>
                    <div class="b-R-foot">
                        <div class="R-foot-tu"></div>
                        <div class="R-foot-zi"></div>
                        <div class="R-foot-an"></div>
                    </div>
                </div>
            </div>

            <div class="footer">

            </div>

        </div>

            

    </body>
</html>

个人感觉,这样写框架,不是很方便,每一个框架的宽度长度,设计的不合理,要改的话,不是很好改,改一个基本上都得改,写出这这整个也很费劲,写完了这个就是填内容,调好图片的大小字体的大小放进去基本上就差不多了。

最终版本
在这里插入图片描述

完整代码

<html>
    <head>
        <title>万豪</title>
        <style type="text/css">
        /*设置整个网页的大小*/
            .over{
                width:800px;
                height: 1000px;
               /* border: brown solid 1px;*/
                margin: 0px auto 0px auto;
            }
            /*头部*/
            .header{
                width:798px;
                height: 100px;
                /*border: brown solid 1px;*/
                margin: 0px 0px 0px 0px;
            }
            .header img{
                width:798px;
                height: 100px;
            }
            /*菜单栏*/
            .caidan{
                width:798px;
                height: 30px;
               /* border: brown solid 1px;*/
                margin: 0px 0px 0px 0px;
            }
            
            .caidan ul{
                width:798px;
                height: 30px;
                margin: 0px 0px 0px 0px;
                padding: 0px;
                list-style: none;
            }
             .caidan li{
                width:77.5px;
                height: 30px;
                margin: 0px 1px;
               text-align: center;
                line-height: 30px;
                float: left;
                font-size: 6;
                background-color: darkgrey;
            }
            /*身体部分*/
            .bodyer{
                width:798px;
                height: 750px;
               /* border: brown solid 1px;*/
                margin: 0px 0px 0px 0px;
            }
            /*身体分成左右两部分*/
            /*L为左部分*/
            .b-L{
                width:500px;
                height: 750px;
               /* border: rgb(11, 219, 133) solid 1px;*/
                float: left;
            }
            /*左部分中的上*/
            .b-L-up{
                width:500px;
                height: 250px;
               /* border:  rgb(81, 25, 185) solid 1px;*/
             
            }
            .zi{
                width:500px;
                height: 40px;
               /* border: rgb(228, 25, 211) solid 1px;*/
            }
            .b-L-up .zi b{
                line-height: 40px;
                font-size: 20;
                float: left;
            }
            .b-L-up .zi p{
                color: rgb(154, 155, 155);
                float: left;
            }
            .tupian{
                width:500px;
                height: 205px;
                /*border:rgb(228, 25, 211) solid 1px;*/
            }
            .tupian img{
                width:500px;
                height: 200px;
            }
            /*左部分中的中间*/
            .b-L-min{
                width:500px;
                height: 250px;
                margin: 2px;
              /*  border: rgb(81, 25, 185) solid 1px;*/
             
            }
            .min-L{
                width:280px;
                height: 250px;
              /*  border: rgb(228, 25, 211) solid 1px;*/
                float: left;
            }
            .min-L-tu{
                width:280px;
                height: 230px;
              /*  border: rgb(10, 213, 228) solid 1px;*/
                
            }
            .min-L-tu img{
                width:280px;
                height: 230px;
            }
            .min-L-zi{
                width:280px;
                height: 18px;
              /*  border: rgb(10, 213, 228) solid 1px;*/
                background-color: dimgrey;
                text-align: center;
            }
            .min-R{
                width:210px;
                height: 250px;
                /*border: rgb(228, 25, 211) solid 1px;*/
                float: right;
            }
            .min-R-tu{
                width:210px;
                height: 40px;
              /*  border: rgb(10, 213, 228) solid 1px;*/
                
            }
            .min-R-tu img{
                line-height: 40px;
            }
            
            .min-R-zi{
                width:210px;
                height: 205px;
               /* border: rgb(10, 213, 228) solid 1px;*/
                
            }
            /*左部分的下*/
            .b-L-foot{
                width:500px;
                height: 245px;
               /* border: rgb(81, 25, 185) solid 1px;*/
             
            }
            .L-up{
                width:500px;
                height: 25px;
                 /*border:rgb(10, 213, 228) solid 1px;*/
            }
            .L-up-L{
                width:110px;
                height: 25px;
                /* border:rgb(10, 213, 228) solid 1px;*/
                float: left;
            }
            .L-up-R{
                width:70px;
                height: 25px;
                 /*border:rgb(10, 213, 228) solid 1px;*/
                float: right;
            }
            .L-foot{
                width:500px;
                height: 220px;
                /* border:rgb(10, 213, 228) solid 1px;*/
            }
            .L-foot-b1{
                width:245px;
                height: 110px;
                 /*border:rgb(10, 213, 228) solid 1px;*/
                float: left;
            }
            .b1-tu{
                width:145px;
                height: 105px;
                 /*border:rgb(10, 213, 228) solid 1px;*/
                float: left;
            }
            .b1-tu img{
                width:145px;
                height: 105px;
            }
            .b1-zi{
                width:95px;
                height: 105px;
                /* border:rgb(10, 213, 228) solid 1px;*/
                float: right;
            }
            .b1-zi p{
                font-size: 8;
            }
            .L-foot-b2{
                width:245px;
                height: 110px;
                /* border:rgb(10, 213, 228) solid 1px;*/
                float: right;
            }
            .L-foot-b3{
                width:245px;
                height: 100px;
                /* border:rgb(10, 213, 228) solid 1px;*/
                float: left;
            }
            .L-foot-b4{
                width:245px;
                height: 100px;
                 /*border:rgb(10, 213, 228) solid 1px;*/
                float: right;
            }
            /*右部分*/
            .b-R{
                width:290px;
                height: 750px;
                /* border: rgb(11, 219, 133) solid 1px;*/
                float: right;
            }
            /*右部分的上*/
            .b-R-up{
                width:290px;
                height: 150px;
                 /*border: rgb(81, 25, 185) solid 1px;*/
                
            }
            .R-up-tu{
                width:290px;
                height: 30px;
                /* border: rgb(81, 25, 185) solid 1px;*/
                
            }
            .R-up-xu{
                width:290px;
                height: 90px;
                 /*border: rgb(81, 25, 185) solid 1px;*/
                
            }
            .R-up-xu ul{
                font-size: 8;
            }
            .R-up-zi{
                width:290px;
                height: 24px;
                /* border: rgb(81, 25, 185) solid 1px;*/
                
            }
            .R-up-zi p{
                float: right;
                color: red;
                font-size: 5;
            }
           
            /*右部分的下*/
            .b-R-foot{
                width:290px;
                height: 200px;
                 /*border: rgb(81, 25, 185) solid 1px;*/
                
            }
             .R-foot-tu{
                width:290px;
                height: 30px;
                 /*border: rgb(81, 25, 185) solid 1px;*/
               line-height: 30px;
                font-size: 9;
            }
           
            .R-foot-zi{
                width:220px;
                height: 30px;
                 /*border: rgb(81, 25, 185) solid 1px;*/
                margin: 0px auto 0px auto;
                font-size: 9;
            }
            .R-foot-an{
                width:190px;
                height: 130px;
                 /*border: rgb(81, 25, 185) solid 1px;*/
                margin: 0px auto 0px auto;
                font-size: 8;
                
            }
            .footer{
                width:798px;
                height: 100px;
                /*border: brown solid 1px;*/
                margin: 0px 0px 0px 0px;
            }
            .footer img{
                width:798px;
                height: 100px;
            }
        </style>
    </head>
    <body>
        <div class="over">
            <div class="header">
                <img src="1.png">
            </div>

            <div class="caidan">
                <ul>
                    <li>首  页</li>
                    <li>关于我们</li>
                    <li>新闻中心</li>
                    <li>装饰案例</li>
                    <li>万豪团队</li>
                    <li>装饰指南</li>
                    <li>一品管家</li>
                    <li>宅 急 修</li>
                    <li>装修订单</li>
                    <li></li>

                </ul>
            </div>

            <div class="bodyer">
                <div class="b-L">
                    <div class="b-L-up">
                        <div class="zi">
                            <b>成功案例</b>
                            
                            <p>&nbsp;&nbsp;&nbsp;&nbsp;Success Case</p>
                        </div>
                        <div class="tupian">
                            <img src="2.png">
                        </div>
                    </div>
                    <div class="b-L-min">
                        <div class="min-L">
                            <div class="min-L-tu">
                                <img src="5.png">
                            </div>
                            <div class="min-L-zi">
                                万丈撒大苏打大苏打撒旦
                            </div>
                        </div>
                        <div class="min-R">
                            <div class="min-R-tu">
                                <img src="7.png">
                                新闻中心&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <img src="6.png">
                            </div>
                            <div class="min-R-zi">
                                <ul>
                                    <li>dasdasdsa</li>
                                    <li>sdasdasdasd</li>
                                    <li>dasdasd</li>
                                    <li>dad</li>
                                    <li>dasda</li>
                                    <li>dasdas</li>
                                    <li>dasdad</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="b-L-foot">
                        <div class="L-up">
                            <div class="L-up-L">
                                <img src="4.png">
                            </div>
                            <div class="L-up-R">
                                <img src="6.png">
                            </div>
                        </div>
                        <div class="L-foot">
                            <div class="L-foot-b1">
                                <div class="b1-tu">
                                    <img src="3.png">
                                </div>
                                <div class="b1-zi">
                                    <p>asda</p>
                                    <p>打打实大大</p>
                                    <p>撒大大苏打阿德飒飒</p>
                                </div>
                            </div>
                            <div class="L-foot-b2">
                                <div class="L-foot-b1">
                                    <div class="b1-tu">
                                        <img src="3.png">
                                    </div>
                                    <div class="b1-zi">
                                        <p>asda</p>
                                        <p>打打实大大</p>
                                        <p>撒大大苏打阿德飒飒</p>
                                    </div>
                                </div>
                            </div>
                            <div class="L-foot-b3">
                                <div class="L-foot-b1">
                                    <div class="b1-tu">
                                        <img src="3.png">
                                    </div>
                                    <div class="b1-zi">
                                        <p>asda</p>
                                        <p>打打实大大</p>
                                        <p>撒大大苏打阿德飒飒</p>
                                    </div>
                                </div>
                            </div>
                            <div class="L-foot-b4">
                                <div class="L-foot-b1">
                                    <div class="b1-tu">
                                        <img src="3.png">
                                    </div>
                                    <div class="b1-zi">
                                        <p>asda</p>
                                        <p>打打实大大</p>
                                        <p>撒大大苏打阿德飒飒</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="b-R">
                    <div class="b-R-up">
                        <div class="R-up-tu">
                            <img src="8.png">&nbsp;&nbsp;&nbsp;</div>
                        <div class="R-up-xu">
                            <ul >
                                <li>dasdsadazcx</li>
                                <li>xczxc</li>
                                <li>zxczczx</li>
                                <li>zxczxczxc</li>
                               
                            </ul>
                        </div>
                        <div class="R-up-zi">
                            <p>&gt;&gt;更多</p>
                        </div>
                    </div>
                    <div class="b-R-foot">
                        <div class="R-foot-tu">
                            <img src="9.png">&nbsp;线&nbsp;&nbsp;</div>
                        <div class="R-foot-zi">
                            <p>请问您是在哪里搜索到我们网站的?</p>
                        </div>
                        <div class="R-foot-an">
                            <input name="1" type="radio" value="">网络搜索
                            <br/>
                            <input name="1" type="radio" value="">网络搜索
                            <br/>
                            <input name="1" type="radio" value="">网络搜索
                            <br/>
                            <input name="1" type="radio" value="">网络搜索
                            <br/>
                            <input name="1" type="radio" value="">网络搜索
                            <br/>
                            <input name="3" type="button" value="投票">
                            &nbsp;  &nbsp;  &nbsp;  &nbsp;
                            <input name="3" type="button" value="查找">
                        </div>
                    </div>
                </div>
            </div>

            <div class="footer">
                <img src="10.png">
            </div>

        </div>

            

    </body>
</html>
  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值