作业上传不了,只能在这上传了,请老师点评~辛苦了
html部分:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>大作业</title>
<link rel="stylesheet" type="text/css" href="2-10大作业.css">
</head>
<body>
<!-- 顶部 -->
<div class="header">
<div class="logo"><img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\logo.png"></div>
<div class="nav">
<ul>
<li><a href="">HOME</a></li>
<li><a href="">ABOUT</a></li>
<li><a href="">GALLERY</a></li>
<li><a href="">FACULTY</a></li>
<li><a href="">EVENTS</a></li>
<li><a href="">CONTACT</a></li>
</ul>
</div>
</div>
<!-- banner区 -->
<div class="banner"><img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\banner3.jpg"></div>
<div class="bannerLayer"></div>
<div class="bannerLayer-top">
<form>
<input class="name" type="text" name="name" placeholder="your Name"><br/>
<input class="phone" type="text" name="phone" placeholder="your Phone"><br/>
<input class="email" type="text" name="email" placeholder="your Email"><br/>
<textarea class="comment" rows="10" cols="30" placeholder="Write Your Comment Here"></textarea><br/>
<input class="submit" type="submit" name="send" value="SEND MESSAGE">
</form>
</div>
<!-- about区 -->
<div class="about">
<div class="top">
<h1>ABOUT</h1>
<div class="line"></div>
<P>Lorem Ipsum is simply dummy text of the printing and typesetting<br/>
industry. Lorem Ipsum has been the industry's standard dumm<br/>
text ever since the 1500s</P>
</div>
<div class="middle">
<div class="left">
<h1> A WORD<br/>ABOUT US</h1>
<p>Praesent dignissim viverra est, sed<br/>
bibendum ligula congue non Sed ac nisti<br/>
et felis gravida commodo? Suspendisse<br/>
eget ullamcorper ipsum. Suspendisse<br/>
diam amet.
<br/>
<input class="explore" type="submit" name="explore" value="EXPLORE">
</div>
<div class="middle-middle">
<img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\bb3.jpg">
</div>
<div class="right">
<div class="students">
<div class="num">70000</div>
<div class="line"></div>
<div class="people">Students</div>
</div>
<div class="faculty">
<div class="num">600</div>
<div class="line"></div>
<div class="people">Faculty</div>
</div>
</div>
</div>
<div class="bottom">
<div class="pic1"><img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\b1.jpg"></div>
<div class="word1">
<h2>Library</h2>
<div class="para1">Lorem Ipsum is simply dummy text of the<br/>printing and typesetting industry
</div>
<div class="para2">Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type
pediment book</div><br/>
<input class="explore" type="submit" name="explore" value="EXPLORE">
<div class="tri1"></div>
</div>
<div class="pic2"><img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\b2.jpg"></div>
<div class="word2">
<h2>Computer Lab</h2>
<div class="para1">Lorem Ipsum is simply dummy text of the<br/>printing and typesetting industry
</div>
<div class="para2">Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type
pediment book</div><br/>
<input class="explore" type="submit" name="explore" value="EXPLORE">
<div class="tri1"></div>
</div>
<div class="word1">
<h2>Conference Hall</h2>
<div class="para1">Lorem Ipsum is simply dummy text of the<br/>printing and typesetting industry
</div>
<div class="para2">Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type
pediment book</div><br/>
<input class="explore" type="submit" name="explore" value="EXPLORE">
<div class="tri2"></div>
</div>
<div class="pic1"><img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\b1.jpg"></div>
<div class="word2">
<h2>Play Ground</h2>
<div class="para1">Lorem Ipsum is simply dummy text of the<br/>printing and typesetting industry
</div>
<div class="para2">Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type
pediment book</div><br/>
<input class="explore" type="submit" name="explore" value="EXPLORE">
<div class="tri2"></div>
</div>
<div class="pic2"><img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\b2.jpg"></div>
</div>
</div>
<!-- gallery区 -->
<div class="gallery">
<div class="top">
<h1>GALLARY</h1>
<div class="line"></div>
<P>Lorem Ipsum is simply dummy text of the printing and typesetting<br/>
industry. Lorem Ipsum has been the industry's standard dumm<br/>
text ever since the 1500s</P>
</div>
<div class="bottom">
<div class="s" id="s1">
<img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\03-01.jpg">
<div class="descri">SCIENCE LAB</div>
</div>
<div class="s" id="s2">
<img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\03-02.jpg">
<div class="descri">INDOOR STADIUM</div>
</div>
<div class="s" id="s3">
<img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\03-03.jpg">
<div class="descri">TRANSPORTATION</div>
</div>
<div class="s" id="s4">
<img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\03-04.jpg">
<div class="descri">KIDS ROOM</div>
</div>
<div class="s" id="s5">
<img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\03-05.jpg">
<div class="descri">MEDITATION CLASSES</div>
</div>
<div class="s" id="s6">
<img src="E:\前端匠\慕课网练习\css大作业\2-10大作业\images\03-06.jpg">
<div class="descri">KIDS PLAY GTOUND</div>
</div>
</div>
</div>
<!-- footer区 -->
<div class="footer">
<p>© 2016 imooc.com 京ICP备13046642号</p>
</div>
</body>
</html>
css部分:
*{
padding: 0;
margin: 0;
}
body{
font-family:"Microsoft YaHei UI";
}
.header{
width: 100%;
height: 80px;
background-color: #07cbc9;
position: fixed;
top: 0;
z-index: 9999;
}
.logo{
margin-top: 14px;
margin-left: 100px;
float: left;
}
.nav ul{
float: right;
margin-right: 80px;
}
.nav ul li{
float: left;
width: 80px;
line-height: 80px;
margin: 0 5px;
list-style-type: none;
font-weight: bold;
text-align: center;
}
.nav ul li:hover{
background-color: gray;
}
.nav ul li a{
text-decoration: none;
color: white;
}
.banner{
padding-top: 80px;
width: 100%;
height: 600px;
}
.banner img{
width: 100%;
height: 600px;
}
.bannerLayer{
position: absolute;
top: 80px;
width: 100%;
height: 600px;
background-color: black;
opacity: 0.5;
z-index:
}
.bannerLayer-top{
width: 506px;
height: 450px;
position: absolute;
top: 190px;
left: 50%;
margin-left: -253px;
}
.name,.phone,.email{
width: 500px;
height: 40px;
border: 3px solid gray;
margin-bottom: 20px;
background: transparent;
}
.comment{
width: 500px;
height: 140px;
border: 3px solid gray;
margin-bottom: 20px;
background: transparent;
font-size:16px;
color: gray;
text-indent: 10px;
font-family:"Microsoft YaHei UI";/*为何此处一定要补充设置字体才能与上面的表单项字体一致?*/
}
.name:hover{
border-color: #07cbc9;
}
.phone:hover{
border-color: #07cbc9;
}
.email:hover{
border-color: #07cbc9;
}
.comment:hover{
border-color: #07cbc9;
}
.submit:hover{
background: #07cbc9;
border: none;
}
.submit{
width: 150px;
height: 50px;
border: 3px solid gray;
margin-bottom: 20px;
margin-left: 178px;
color: gray;
font-weight: bold;
background: transparent;
}
input::placeholder{
font-size:16px;
color: gray;
text-indent: 10px;
}
.about .top,.gallery .top{
width: 600px;
margin: 0 auto;
margin-top: 40px;
text-align: center;
}
.about .top .line,.gallery .top .line{
width: 50px;
height: 20px;
border: 2px solid #07cbc9;
margin-top: 22px;
margin-left: 273px;
border-color: #07cbc9 transparent transparent transparent;
}
.about .top p,.gallery .top p{
font-size: 16px;
color: gray;
}
.about .middle{
width: 70%;
height: 435px;
margin: 0 auto;
margin-top: 35px;
}
.about .middle .left{
float: left;
z-index: 222;
margin-left: 20px;
}
.about .middle .left h1{
width: 200px;
margin-left: 10px;
font-weight: normal;
}
.about .middle .left p{
border: 1px solid white;
padding: 20px;
background-color: rgba(225,225,225,0.3);
margin-top: 10px;
position: absolute;
z-index: 222;
}
.about .middle .left input{
width: 100px;
height: 50px;
background-color: black;
color: white;
border: none;
margin-top: 20px;
}
.about .middle .middle-middle{
float: left;
position:absolute;
left: 420px;
}
.about .middle .middle-middle img{
height: 350px;
}
.about .middle .right{
float: right;
}
.students,.faculty{
width: 180px;
height: 120px;
border: 1px solid #07cbc9;
margin-bottom: 20px;
text-align: center;
}
.right .line{
width: 50px;
height: 15px;
border: 2px solid #07cbc9;
margin-top: 22px;
margin-left: 64px;
border-color: #07cbc9 transparent transparent transparent;
}
.num{
font-size: 26px;
font-weight: bold;
margin-top: 10px;
}
.about .bottom{
width: 100%;
height: 600px;
}
.pic1,.word1,.pic2,.word2{
width: 25%;
height: 300px;
float: left;
}
.pic1 img,.pic2 img{
width: 100%;
height: 300px;
}
.word1,.word2{
font-size: 12px;
padding: 30px;
background-color: #07cbc9;
box-sizing: border-box;
}
.word1 .para1,.word1 .para2,.word2 .para1,.word2 .para2{
margin-top: 20px;
}
.word1 h2,.word2 h2{
color: white;
}
.word1 .para1,.word2 .para1{
color: white
}
.word1 .para2,.word2 .para2{
color: gray;
}
.word1 input,.word2 input{
width: 80px;
height: 40px;
background-color: black;
border: none;
color: white;
margin-left: 88px;
margin-top: 20px;
}
.about .middle .left .explore:hover{
color: black;
background-color: transparent;
border:1px solid black;
}
.about .bottom .explore:hover{
color: black;
background-color: transparent;
border:1px solid black;
}
.tri1{
width: 0;
height: 0;
border-top:15px solid transparent;
border-left:15px solid transparent;
border-bottom:15px solid transparent;
border-right:15px solid #07cbc9;
margin-left: -60px;
margin-top: -130px;
}
.tri2{
width: 0;
height: 0;
border-top:15px solid transparent;
border-right:15px solid transparent;
border-bottom:15px solid transparent;
border-left:15px solid #07cbc9;
margin-left: 307px;
margin-top: -130px;
z-index: 2222;
position: absolute;/*这里单独设置绝对定位就可以实现三角形层级在上面了。。为何?relative不用设置吗?*/
}
.gallery .bottom{
width: 60%;
height: 480px;
margin: 20px auto;
}
.bottom .s{
width: 33.33%;
float: left;
padding: 10px;
box-sizing: border-box;
}
.bottom .s img{
width: 100%;
height: auto;
display: block;
}
.descri{
width: 100%;
height: 40px;
line-height: 40px;
background-color: black;
color: gray;
font-size: 12px;
text-indent: 10px;
}
.footer{
width: 100%;
height: 50px;
background-color: #07cbc9;
color: white;
}
.footer p{
width: 400px;
height: 50px;
line-height: 50px;
margin: 0 auto;
text-align: center;
}
正在回答 回答被采纳积分+1
同学你好!
同学可以在代码中标注相关的注释,以便后期维护哦~
作业效果总体实现效果是很好的哦~有一些问题, 问题如下:
(1)顶部导航栏右侧的链接间隙应该是相同的,每个li的宽度是不同的,因此建议不要给li设置宽度,而是使用padding来撑大左右间隙,
(2)图文混排区域的三角形实现,在老师这边那是没有显示出来的,可能是因为分辨率不同:
以这个三角形为例,可以给它的父级设置相对定位,而三角形使用top/right的方式布局出来,top:50%,margin-top:负的元素高度一半是可以 实现垂直居中的;另,同学在注释中问的问题,可以查看如下图片:
如果帮助到了你 欢迎采纳 祝学习愉快~
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36713 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星