老师我看写的行吗?
来源:4-10 自由编程
神知
2021-10-22 17:43:45
<!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">
<link href="css/style.css" rel="stylesheet" type="text/css">
<title>小慕作业</title>
</head>
<body>
<!--网页头部-->
<header>
<div class="hd-nav">
<!--网页logo-->
<div class="logo">
<a href="#"><img src="images/logo.png" alt="logo"/></a>
</div>
<!--网页功能区-->
<nav class="nav">
<ul>
<li>HOME</li>
<li>ABOUT</li>
<li>GALLERY</li>
<li>FACULTY</li>
<li>EVENTS</li>
<li>CONTACT</li>
</ul>
</nav>
</div>
</header>
<div class="banner"><!--Banner区域-->
<div class="pic">
<img src="images/banner3.jpg" alt="海报图片"/>
</div>
<div class="zhezhao"></div>
<div class="biaoge">
<form>
<input type="text" name="uname" placeholder="your name">
<input type="text" name="tel" placeholder="your Phone">
<input type="email" name="email" placeholder="your email">
<textarea placeholder="Write Your Comment Here"></textarea>
<input type="submit" value="SEND MESSAGE" name="btn">
</form>
</div>
</div>
<div class="about"><!--about区域-->
<dl>
<dt>ABOUT</dt>
<dd class="heng"></dd>
<dd>Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum has been the industry is standard dummy text ever since the 1500s</dd>
</dl>
<div class="about-miaoshu">
<div class="about-left">
<span class="bt">A WORD ABOUT US</span>
<div class="about-left-miaoshu">
<span>Praesent dignissim viverra est, sed bibendum ligula congue non. Sed ac nisl et felis gravida commodo? Suspendisse eget ullamcorper ipsum. Suspendisse diam amet.</span>
<a class="about-left-button" href="#">EXPLORE</a>
</div>
</div>
<div class="about-middle">
<img src="images/bb3.jpg" alt="about描述"/>
</div>
<div class="about-right">
<div class="about-right-top">
<p>70000</p>
<p class="heng"></p>
<p>Students</p>
</div>
<div class="about-right-bottom">
<p>600</p>
<p class="heng"></p>
<p>Faculty</p>
</div>
</div>
</div>
</div>
<div class="hunpai"><!--图文混排-->
<ul>
<li><img src="images/b1.jpg" alt="图片1"/></li>
<li>
<p class="title">Library</p>
<p class="title2">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="detail">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 specimen book.</p>
<a>EXPLORE</a>
</li>
<li><img src="images/b2.jpg" alt="图片2"/></li>
<li>
<p class="title">Library</p>
<p class="title2">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="detail">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 specimen book.</p>
<a>EXPLORE</a>
</li>
<li>
<p class="title">Library</p>
<p class="title2">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="detail">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 specimen book.</p>
<a>EXPLORE</a>
</li>
<li><img src="images/b3.jpg" alt="图片3"/></li>
<li>
<p class="title">Library</p>
<p class="title2">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="detail">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 specimen book.</p>
<a>EXPLORE</a>
</li>
<li><img src="images/b4.jpg" alt="图片4"/></li>
</ul>
<a>文字4</a>
<a>文字6</a>
<a>文字8</a>
</div>
<div class="gallery"><!--Gallery区域-->
<dl class="gallery-top">
<dt><img src="images/03-01.jpg" alt="图片1"/></dt>
<dd>Science Lab</dd>
<dt><img src="images/03-02.jpg" alt="图片2"/></dt>
<dd>Indoor Stadium</dd>
<dt><img src="images/03-03.jpg" alt="图片3"/></dt>
<dd>Transportation</dd>
</dl>
<dl class="gallery-bottom">
<dt><img src="images/03-04.jpg" alt="图片4"/></dt>
<dd>Kids Room</dd>
<dt><img src="images/03-05.jpg" alt="图片5"/></dt>
<dd>Meditation Classes</dd>
<dt><img src="images/03-06.jpg" alt="图片6"/></dt>
<dd>Kids Play Ground</dd>
</dl>
</div>
<footer></footer>
</body>
</html>
*{
padding: 0;
margin: 0;
}
/*头部header样式*/
header{
width: 100%;
height: 80px;
background: #07cbc9;
}
header .hd-nav{
width: 1200px;
margin: 0 auto;
}
header .hd-nav .logo{
float: left;
position: relative;
top: 16px;
}
header .hd-nav .nav{
float: right;
}
header .hd-nav .nav ul li{
float: left;
margin-right: 20px;
list-style: none;
line-height: 80px;
color: #fff;
}
/*海报样式*/
.banner{
width: 100%;
height: 600px;
position: relative;
}
.banner .zhezhao{
width: 100%;
height: 600px;
background: rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
left: 0;
}
.banner .pic{
height: 600px;
}
.banner .pic img{
width: 100%;
height: 600px;
}
.banner .biaoge{
width: 506px;
position: absolute;
top: 100px;
left: 50%;
margin-left: -253px;
}
.banner .biaoge input{
width: 504px;
height: 40px;
background: none;
margin-bottom: 20px;
border: 1px solid #808080;
color:#808080;
position: relative;
}
.banner .biaoge textarea{
height: 110px;
width: 504px;
background: none;
margin-bottom: 20px;
}
.banner .biaoge input:last-child{
width: 200px;
height: 40px;
display: block;
margin:0 auto;
}
/*about区域*/
.about{
width: 1201px;
height: 650px;
margin: 0 auto;
margin-top: 30px;
position: relative;
}
.about-miaoshu{
position: relative;
}
.about dl{
width: 1201px;
text-align: center;
margin: 0 auto;
margin-bottom: 30px;
}
.about dl dt{
font-size: 32px;
text-align: center;
font-weight: 700;
}
.about dl .heng{
width: 60px;
height: 3px;
background: #07cbc9;
margin: 10px auto;
}
.about dl dd{
text-align: center;
color: gray;
font-size: 14px;
width: 455px;
margin: 0 auto;
}
/*about左侧描述*/
.about-left{
width: 260px;
position: absolute;
top: 0;
left: 0;
}
.about-left .bt{
font-size: 32px;
text-align: left;
font-weight: 700;
margin-bottom: 23px;
display: block;
}
.about-left-miaoshu{
width: 300px;
padding: 20px;
font-size: 18px;
border: 1px solid gray;
background: rgba(255, 255, 255, 0.5);
}
.about-left-miaoshu .about-left-button{
width: 140px;
height: 40px;
background: #000;
margin-top: 30px;
display: inline-block;
text-align: center;
text-decoration: none;
font-size: 14px;
line-height: 40px;
color: #fff;
}
/*about中间图片*/
.about-middle{
width: 650px;
height: 435px;
margin: 0 auto;
}
/*about右侧样式*/
.about-right{
position: absolute;
right: 0;
top: 0;
}
.about-right .about-right-top, .about-right .about-right-bottom{
width: 260px;
height: 86px;
border: 1px solid #07cbc9;
padding: 40px 0;
text-align: center;
}
.about-right .about-right-top p:first-child, .about-right .about-right-bottom p:first-child{
font-size: 28px;
font-weight: 700;
}
.about-right .about-right-top .heng, .about-right .about-right-bottom .heng{
width: 60px;
height: 3px;
background: #07cbc9;
margin: 10px auto;
}
.about-right .about-right-top{
margin-bottom: 30px;
}
/*图文混排*/
.hunpai{
width: 100%;
}
.hunpai ul li{
width: 25%;
height: 380px;
float: left;
list-style-type: none;
}
.hunpai ul li img{
width: 100%;
height: 380px;
}
.hunpai ul li:nth-of-type(odd),.hunpai ul li:nth-of-type(even){
background: #07cbc9;
}
.hunpai ul li .title{
font-size: 24px;
color: #fff;
margin-top: 20px;
margin-left: 20px;
}
.hunpai ul li .title2{
font-size: 16px;
color: #fff;
margin-top: 30px;
margin-left: 20px;
}
.hunpai ul li .detail{
font-size: 14px;
color: gray;
margin-top: 20px;
margin-left: 20px;
margin-bottom: 30px;
}
.hunpai ul li a{
width: 138px;
height: 40px;
background: #000;
line-height: 40px;
display: block;
color: #fff;
text-align: center;
margin: 0 auto;
}
1回答
好帮手慕小李
2021-10-22
同学你好,作业完成的很不错哟,望继续努力哈~
优化建议,老师的屏幕较窄,下图中文字的左右间距显示不对称:

建议设置成左右对称间距:

祝学习愉快~
相似问题