老师您好,check pls. thsnks a lot.

老师您好,check pls. thsnks a lot.

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

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

<title></title>

<style type="text/css" media="screen">

*{

padding: 0;

margin: 0;

}

.top{

width:100%;

height: 80px;

line-height: 80px;

background: #07cbc9;

overflow: hidden;



}


.top_left{

float: left;

margin-left: 50px;

height: 80px;

}

.top_left img{

padding: 16px 10px;


}

.top_right{

float: right;

}

.top_right ul{

padding-right: 50px;

}

.top_right ul li{

float: left;

padding: 0 10px;

margin: 0 10px;

list-style: none;

text-align: center;

}

.top_left a,.top_right ul li a{

text-decoration: none;

color: #fff;


}

.top_left:hover{

background: gray;

border-radius: 10px;

}

.top_right ul li:hover{

background: gray;

border-radius: 10px;


}

/*banner区域*/

.banner{

position: relative;

}

.banner_img img{

width: 100%;

height: 600px;

}

.mask{

position: absolute;

top:0;

left: 0;

width: 100%;

height: 600px;

background: #fff;

opacity: 0.1;

}

.banner_middle{

width: 600px;

height: 400px;

position: absolute;

top:50%;

left: 50%;

margin-top: -200px;

margin-left: -300px;


}

.banner_middle .inp{

display: block;

width:505px;

height: 39px;

border: 2px solid gray;

margin:20px auto;

border-radius: 3px;

background: transparent;

}

.inpu{

width: 505px;

height: 119px;

display: block;

border: 2px solid gray;

margin:20px auto;

background: transparent;

border-radius: 3px;

}

.sub{

display: block;

width: 123px;

height: 39px;

margin:20px auto;

background: transparent;

border: 2px solid gray;

border-radius: 3px;

}

.banner_middle input:hover{

border-color: #07cbc9;

}

.sub:hover{

border: none;

background: #07cbc9;

}

/*about区域*/

.about{

width: 100%;

position: relative;

}

.about_top{

width: auto;

height: auto;

margin-bottom: 30px;

}

.about_top1{

text-align: center;

font-size: 32px;

font-weight: bold;

margin-top: 20px;

margin-bottom: 10px;

}

hr{

width: 30px;

border: 2px solid #07cbc9;

margin: 10px auto;


}

.about_top2{

width: 400px;

height: auto;

margin: 0 auto;

text-align: center;

font-size: 17px;

line-height: 30px;

}


.about_center_center img{

display: block;

width: 550px;

height: 350px;

margin: 0 auto;

}

.about_center_left{

width: 350px;

height: 150px;

border: 1px solid gray;

padding: 20px;

position: absolute;

left: 100px;

top: 300px;

background: rgba(255, 255, 255, 0.4);


line-height: 25px;

}

.about_btn_box{

position: absolute;

left: 120px;

top: 400px;

z-index: 99;

}

.about_btn{

width: 102px;

height: 45px;

background: black;

color: #fff;

cursor: pointer;

}

.about_btn:hover{

background: transparent;

border:1px solid black;

color: black;

font-style: bold;

border-radius: 5px;


}

.about_center_right{

position: absolute;

top:187px;

left: 1000px;


}

.about_center_right hr{

width: 40px;

text-align: center;

margin-top: 50px;

}

.about_center_right1{

width: 200px;

height:110px;

border: 1px solid #07cbc9;

}

.about_center_right2{

width: 200px;

height:110px;

border: 1px solid #07cbc9;

margin: 20px 0;

}

.text{

font-size: 45px;

font-weight: bold;

position: absolute;

text-align: center;

top:180px;

left: 130px;

width: 200px;

height: 150px;

}

.about_bottom{

width: 100%;

overflow: hidden;

}

.bottom_text{

float: left;

width: 25%;

height: 337px;

background: #07cbc9;

}

.bottom_img{

float:left;

width: 25%;

height: 337px;

position: relative;

}

.bottom_img img{

display: block;

width: 100%;

height: 100%;

}

.arrow{

width:0;

    height:0;

    border-width:30px 30px 30px 0;

    border-style:solid;

    border-color:transparent #07cbc9 transparent transparent;/*透明 透明 透明 灰*/

    position:absolute;

    top: 40%;

    left: 92%;


}

.bottom_text_top{

font-size: 21px;

font-weight: bold;

margin-top: 20px;

margin-left: 20px;

margin-bottom: 10px;

color: #fff;

}

.bottom_text_center{

width: 80%;

font-size: 18px;

margin-left: 20px;

color: #fff;

margin-bottom: 10px;

}

.bottom_text_bottom{

font-size: 13px;

color: #fff;

margin-left: 20px;

position: relative;

}

.bottom_button button{

width: 102px;

height: 45px;

position: absolute;

bottom:-150%;

left: 30%;

background: black;

color: #fff;

border: none;

cursor: pointer;

}

.arrow2{

width:0;

        height:0;

        border-width:30px 0 30px 30px;

        border-style:solid;

        border-color:transparent transparent transparent #07cbc9;/*透明 透明 透明 灰*/

        margin:40px auto;

        position:absolute;

        top:40%;

        left: 0;

}

.gallery_top{

width: 100%;

}

.gallery_top1{

font-size: 30px;

text-align: center;

margin: 20px auto;

font-weight: bold;

}

.gallery_top2{

text-align: center;

width: 30%;

margin: 0 auto;

line-height: 30px;

}

.gallery_center_img{

width: 360px;

height: 304px;

float: left;

padding: 0 22px;

margin-bottom: 30px;


}

.gallery_center_img img{

width: 360px;

height:240px;

display: block;

}

.gallery_center_text{

background: black;

height: 64px;

color: #fff;

line-height: 64px;

padding-left: 50px;

}

.gallery_center{

width: 100%;

}

.gallery_box{

width: 90%;

margin: 10px auto;

overflow: hidden;

}

.ll{

width: 100%;

height: 80px;

background: #07cbc9;

text-align: center;

line-height: 80px;

font-size: 20px;

color: #FFF;

}



</style>

</head>

<body>

<div class="top">

<div class="top_left"><a href="#"><img src="img/logo.png"></a></div>

<div class="top_right">

<ul>

<li><a href="#">HOME</a></li>

<li><a href="#">ABOUT</a></li>

<li><a href="#">GALLERY</a></li>

<li><a href="#">FACULITY</a></li>

<li><a href="#">EVENTS</a></li>

<li><a href="#">CANTANCT</a></li>

</ul>

</div>

</div>

<!-- banner区域 -->

<div class="banner">

<div class="banner_img">

<img src="img/banner3.jpg">

</div>

<!-- 遮罩层 -->

<div class="mask">

</div>

<div class="banner_middle">

<form>

<input class="inp" type="text" name="mane" placeholder="your name">

<input class="inp" type="text" name="phone" placeholder="your phone">

<input class="inp" type="email" name="email" placeholder="email">

<textarea class="inpu" name="jianjie" placeholder="write your comment here"></textarea>

<button class="sub" type="submit">send message</button>

</form>

</div>

</div>

<!-- about区域 -->

<div class="about">

<div class="about_top">

<div class="about_top1">

about

</div>

<hr>

<div class="about_top2">

请使用样式取代它。 规定hr 元素的宽度。全局属性  标签支持 HTML 中的全局属性请使用样式取代它。 规定hr 元素的宽度。全局属性  标签支持 HTML 

</div>

</div>

<div class="about_center">

<div class="about_center_center">

<img src="img/bb3.jpg">

</div>

<div class="text">

<span>a world <br>about us</span>

</div>

<div class="about_center_left">

<span>

请使用样式取请使用样式取代它。 规定hr 元素的宽度。全局属性  标签支持 HTML 中的全局属性请使用样式取代它。 规定hr 

</span>

</div>

<div class="about_btn_box">

<button class="about_btn" type="submit" >EXPLORE</button>

</div>

<div class="about_center_right">

<div class="about_center_right1">

<hr>

</div>

<div class="about_center_right2">

<hr>

</div>

</div>

<div class="about_bottom">

<div class="bottom_img">

<img src="img/b1.jpg">

<div class="arrow"></div>

</div>

<div class="bottom_text">

<div class="bottom_text_top">

<span>

library

</span>

</div>

<div class="bottom_text_center">

The library was founded in 1912 and has a history of nearly 100 years. 

</div>

<div class="bottom_text_bottom">

<span>

The new library is located at No.98 WenWeng Road, Qingyang District, Chengdu. In 2010, it was rated as the national first level library by the Ministry of culture

</span>

<div class="bottom_button">

<button type="submit">EXPLORE</button>

</div>

</div>

</div>


<div class="bottom_img">

<img src="img/b2.jpg">

<div class="arrow"></div>

</div>

<div class="bottom_text">

<div class="bottom_text_top">

<span>

library

</span>

</div>

<div class="bottom_text_center">

The library was founded in 1912 and has a history of nearly 100 years. 

</div>

<div class="bottom_text_bottom">

<span>

The new library is located at No.98 WenWeng Road, Qingyang District, Chengdu. In 2010, it was rated as the national first level library by the Ministry of culture

</span>

<div class="bottom_button">

<button type="submit">EXPLORE</button>

</div>

</div>

</div>


<div class="bottom_text">

<div class="bottom_text_top">

<span>

library

</span>

</div>

<div class="bottom_text_center">

The library was founded in 1912 and has a history of nearly 100 years. 

</div>

<div class="bottom_text_bottom">

<span>

The new library is located at No.98 WenWeng Road, Qingyang District, Chengdu. In 2010, it was rated as the national first level library by the Ministry of culture

</span>

<div class="bottom_button">

<button type="submit">EXPLORE</button>

</div>

</div>

</div>

<div class="bottom_img">

<img src="img/b3.jpg">

<div class="arrow2"></div>

</div>

<div class="bottom_text">

<div class="bottom_text_top">

<span>

library

</span>

</div>

<div class="bottom_text_center">

The library was founded in 1912 and has a history of nearly 100 years. 

</div>

<div class="bottom_text_bottom">

<span>

The new library is located at No.98 WenWeng Road, Qingyang District, Chengdu. In 2010, it was rated as the national first level library by the Ministry of culture

</span>

<div class="bottom_button">

<button type="submit">EXPLORE</button>

</div>

</div>


</div>

<div class="bottom_img">

<img src="img/b4.jpg">

<div class="arrow2"></div>

</div>

</div>

</div>

</div>

<!-- gallery区域 -->

<div class="gallery_top">

<div class="gallery_top1">

GALLERY

</div>

<hr>

<div class="gallery_top2">

w library is located at No.98 WenWeng Road, Qingyang District, Chelocated at No.98 WenWeng Road, Qingyang District,ngdu. In 2010, it was rated as the national

</div>

<div class="gallery_center">

<div class="gallery_box">

<div class="gallery_center_img">

<img src="img/03-01.jpg">

<div class="gallery_center_text">

SCIENCE LAB

</div>

</div>


<div class="gallery_center_img">

<img src="img/03-02.jpg">

<div class="gallery_center_text">

SCIENCE LAB

</div>

</div>


<div class="gallery_center_img">

<img src="img/03-03.jpg">

<div class="gallery_center_text">

SCIENCE LAB

</div>

</div>



<div class="gallery_center_img">

<img src="img/03-04.jpg">

<div class="gallery_center_text">

SCIENCE LAB

</div>

</div>


<div class="gallery_center_img">

<img src="img/03-05.jpg">

<div class="gallery_center_text">

SCIENCE LAB

</div>

</div>


<div class="gallery_center_img">

<img src="img/03-06.jpg">

<div class="gallery_center_text">

SCIENCE LAB

</div>

</div>

</div>


</div>

</div>


<!-- bottom区域 -->

<div class="ll">

@2016 imooc.com&nbsp;京ICP备1822713395

</div>

</body>

</html>


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

同学你好!

1.顶部没有实现固定定位,建议使用fixed:

http://img1.sycdn.imooc.com//climg/5dbd50c809bf77ef03030218.jpg

2.这样的话,顶部脱离了文档流,banner图片就会往上移动,建议设置一定的边距:

http://img1.sycdn.imooc.com//climg/5dbd512209cfe84102140119.jpg

那么遮罩层也需要设置:

http://img1.sycdn.imooc.com//climg/5dbd514009927e4c03000244.jpg

3.about区域中没有实现居中,而且这部分布局比较复杂:

http://img1.sycdn.imooc.com//climg/5dbd517809186a7515380586.jpg

给同学如下实现思路:设置一个大的div,然后设置这个div居中,注意这里的宽度要和GALLERY区的宽度一致,建议设置为1000px左右,里面4个小的div。上面一个div包含文字,下面3个div包含左中右三块,并设置浮动使显示在一行。

http://img1.sycdn.imooc.com//climg/5dbd4f2709e784b207910312.jpg

最后在设置一个div容纳遮罩的这部分,并使用绝对定位,要相对于上面说到的大div。

4.图文混排指向三角形和旁边的div不是挨着的,这里可以优化:

http://img1.sycdn.imooc.com//climg/5dbd4fe7090cfc9404520296.jpg

如下:

http://img1.sycdn.imooc.com//climg/5dbd500809f7404e04210255.jpg

5.底部gallery总体没有实现居中,可以给.gallery_box设置固定的宽度。gallery_center_img的宽度是360px,padding左右共44px  (360+44)*3=1212;

http://img1.sycdn.imooc.com//climg/5dbd506f09a2375d02630135.jpg

同学可以继续优化一下,完成之后建议提交到作业批复区,会有老师帮助同学指出作业中的问题并且修改哦。

如果帮到了你,欢迎采纳,祝学习愉快~

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师