页面缩小到1200px时

来源:3-10 作业题

Perfect雪儿

2019-08-22 17:35:43

http://img.mukewang.com/climg/5d5e61d20001bb4804220289.jpg

老师,我给body设置了min-width不起作用啊?要怎么设置呢

写回答

6回答

好帮手慕夭夭

2019-08-23

你好同学,你给老师的页面和你自己测试的页面不一样哦。请把你测试出问题的页面,把所有的html ,css代码都粘贴到问答区域,以便老师准确高效的为你查找问题哦。

祝学习愉快!

0

Perfect雪儿

提问者

2019-08-22

老师,我这边和你不一样,我用的谷歌浏览器

http://img.mukewang.com/climg/5d5e81c40001893509910616.jpg

0

好帮手慕夭夭

2019-08-22

你好同学,老师这边测试是生效的,如下:

设置最小宽度就是当浏览器缩小到1200px之后,再继续缩小,页面保持在1200px不变了。所以页面比浏览器宽度大,就会超出屏幕出现横向滚动条来显示多出的内容。

http://img.mukewang.com/climg/5d5e7b840001962b09450940.jpg

再测试一下哦,祝学习愉快,望采纳。

0

Perfect雪儿

提问者

2019-08-22

/* 头部 */
body{
	background-color: #fff; 
	margin: 0;
	padding: 0;
	font-size: 12px;
	font-family: "Microsoft Yahei",微软雅黑;
	min-width: 1200px;
}
ul,li{
	list-style: none;
}
p{
	margin: 0;
	padding: 0;
}
header{
    width: 100%;
    height: 120px;
    background-color: #efefef; 
    border-bottom: 2px solid blue;
}
.header__wrap{
    width: 1100px;
    height: 120px;
    margin: 0 auto;
}
.header__wrap .left{
    width: 400px;
    height: 120px;
    float: left;
}
.header__wrap .left .logo{
    background-image: url(../img/logo.png);
    width: 110px;
    height: 110px;
    float: left;
    margin-top: 5px;
}
.header__wrap .left .logo,
.header__wrap .left p{
    cursor: pointer;
}
.header__wrap .left p{
    float: left;
    line-height: 120px;
}
.header__wrap .left .lg{
    font-size: 18px;
}
.header__wrap .left .symbol{
    font-size: 22px;
    padding: 0 5px;
}
.header__wrap .left .lo{
    color: #666;
}
.header__wrap .right{
    width: 690px;
    height: 120px;
    float: right;
    text-align: right;
}
.header__wrap .right ul{
    margin: 0 auto;
    line-height: 120px;
    float: right;
}
.header__wrap .right .pig:hover{
    cursor: pointer;
    color: rgb(251,116,3);
}
.header__wrap .right .one{
    z-index: 3;
}
.header__wrap .right ul li,
.header__wrap .right ul p
{
    float: left;
    padding: 0 7px;
}
.header__wrap .right .arrow{
    position: relative;
}
.header__wrap .right .arrow::after{
    content: "";
    width: 0px;
    height: 0px;
    border-top: 7px solid #000;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    position: absolute;
    top: 59px;
    right: -15px;
}
.header__wrap .right .mainphone{
    position: relative;
    margin-left: 60px;
}
.header__wrap .right .phone{
    background-image: url(../img/未标题-1.png);
    background-repeat: no-repeat; 
    width: 59px;
    height: 85px;
    position: absolute;
    background-size: 25%;
    top: 50px;
    left: -5px;
}
.header__wrap .right .box{
    width: 200px;
    background-color: #fcfcfc;
    padding: 0;
    margin: 0;
    border: 1px solid  rgb(251,116,3);
}
.header__wrap .right .box li{
    line-height: 40px;
    color: #7d7e81;
}
 
/* 主体 */
main{
    width: 100%;
    height: 750px;
}
main .maintain{
    width: 1100px;
    margin: 0 auto; 
}
main .title{
    padding: 10px;
}
main .title .pug{ 
    color: #666;
}
main .account{
    border: 1px solid rgb(251,116,3);
    border-radius: 5px;
    height: 620px;
}
main .account .accountb{
    background-color: rgb(251,116,3);
    color: #fff;
    height: 40px;
    border-radius: 5px;
    line-height: 40px;
    text-indent: 10px;
}
main .account .information{
    margin: 50px auto;
    width: 700px;
    position: relative;
}
main .account .information .item .important{
    color: rgb(251,116,3);
}
main .account .information .item .distance{
    letter-spacing:0;
}
main .account .information .item  .colon{
    padding-right: 10px;
    padding-left: 5px;
}
main .account .information .item .distancea{
   letter-spacing:.65em;
} 
main .account .information .item .distanceb{
   letter-spacing:.1em;
} 
main .account .information .item .distancec{
   letter-spacing:2.3em;
}
main .account .information .item label{
    font-size: 13px;
    font-weight: bold;
}
main .account .information .item input{
    width: 210px;
    border: 1px solid #a9a9bb;
    text-indent: 5px;
    height: 25px;
}
main .account .information .item input::-webkit-input-placeholder{
    color:#a9a9bb;
}
main .account .information .item input::-moz-placeholder{   /* Mozilla Firefox 19+ */
    color:#a9a9bb;
}
main .account .information .item input:-moz-placeholder{    /* Mozilla Firefox 4 to 18 */
    color:#a9a9bb;
}
main .account .information .item input:-ms-input-placeholder{  /* Internet Explorer 10-11 */
    color:#a9a9bb;
}
main .account .information .item select{
    width: 212px;
    height: 25px;
    border: 1px solid #a9a9bb;
    text-indent: 5px;
}
main .account .information .item{
    display: inline-block;
    margin-bottom: 15px;
}
main .account .information .item_{
    display: inline;
}
#end{
    position: absolute;
    left: 85px;
}
#end #handup{
    width: 150px;
    height: 30px;
    display: block;
    background-color: rgb(251,116,3);
    border: none; 
    border-radius: 5px;
    color: #fff;
    position: absolute;
    top: 70px;
    left: 40px;
}
#end #handup:hover{
    background-color: #ff0000;
    cursor: pointer;
}
#end span{
    color: #006ee1;
}
#strength{
    width: 30px;
    height: 7px;
    margin-left: 3px; 
    background-color: #ddd; 
    display: inline-block;
    display: none;
}
 
/* 尾部 */
.footer{
    background-color: #dcdcdc;
    height: 100px;
    border-top: 2px solid blue;
}
.footer__nav{
    margin: 0;
    padding: 20px;
    width: 500px;
    margin: 0 auto;
    text-align: center;
}
.footer__nav .footer__nav__item{
    color: #a99999;
    display: inline-block;
}
.footer p{
    color: #a99999;
    text-align: center;
}


0

Perfect雪儿

提问者

2019-08-22

<!DOCTYPE html>
<html lang = "en">
<head>
    <meta charset = "UTF-8">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <link rel="stylesheet" type="text/css" href="css/base.css">
</head>
<body>
    <!-- 头部 -->
    <header>
        <div class = "header__wrap">
            <div class = "left">
                <div class = "logo"></div>
                <p class="lg">慕课高铁客户服务中心</p>
                <p class="symbol">|</p>
                <p class="lo">客户服务</p>
            </div>
            <div class = "right">
                <ul>
                    <li>意见反馈</li>
                    <li class="pig">imooc@com</li>
                    <li>
                        <span>您好,请</span> 
                        <span  class="pig">登录</span>
                        <span>|</span> 
                        <span  class="pig">注册</span>
                    </li>
                    <li class="pig arrow">我的IMOOC</li>
                    <li class="mainphone">
                        <p  class="pig one">手机版</p>
                        <span  class = "phone"></span>
                         
                    </li>
                </ul>
            </div>
        </div>
    </header>
</body>
</html>


0

好帮手慕夭夭

2019-08-22

你好同学,请把自己的代码都粘贴到问答区域,以便老师准确高效的为你查看问题。

祝学习愉快!

0
herfect雪儿
h 老师,我回复在上面了,麻烦帮忙看下
h019-08-22
共1条回复

0 学习 · 14456 问题

查看课程