麻烦老师检查代码

来源:4-6 自由编程

轩神

2021-02-14 22:31:51

*{
margin: 0;
padding: 0;
}
ul, ol{
list-style: none;
}
.header{
width: 100%;
height: 80px;
background-color: #07cbc9;
}
.header .header-top {
height: 80px;
width: 1200px;
margin: 0 auto;
}
.header .header-top .logo {
float: left;
height: 48px;
margin:16px auto;
}
.header .header-top .nav {
float: right;
}
.header .header-top .nav ul {
margin:0 auto;
}
.header .header-top .nav ul li {
float:left;
text-align:center;
line-height: 80px;
margin-right:20px;
}
.header .header-top .nav ul li a {
display: block;
text-decoration: none;
color:white;
font-size:16px;
}
.banner {
position:relative;
width: 100%;

}
.banner .b-pic {
width: 100%;
height: 600px;
}
.banner .mask {
position: absolute;
width: 100%;
height: 600px;
background:rgba(0, 0, 0, 0.5);
left: 0;
top: 0;
}

.banner .form {
position: absolute;
width: 504px;
height: 350px;
top:100px;
left: 50%;
margin-left:-252px;
text-align:center;


}
.banner .form input.cur{
width: 500px;
height: 36px;
color: #808080;
border: 2px solid #808080;
margin-bottom: 20px;
outline: none;
background: none;
}
.banner .form textarea {
width: 500px;
height: 106px;
color: #808080;
border: 2px solid #808080;
margin-bottom: 20px;
outline: none;
background: none;
}
.banner .form .submit {
width: 196px;
height: 36px;
color: #808080;
border: 2px solid #808080;
outline: none;
background: none;
cursor: pointer;
}
​<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/css.css">
</head>
<body>
<!-- Header区域 -->
<div class="header">
<div class="header-top">
<!-- 网页的logo 左 -->
<div class="logo">
<img src="images/logo.png" alt="这是logo">
</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>
</div>

<!-- Banner区域 -->
<div class="banner">
<!-- 图片 -->
<div>
<img class="b-pic" src="images/banner3.jpg" alt="图片">
</div>

<!-- 遮罩层 -->
<div class="mask">banner遮罩层</div>

<!-- 表单 -->
<div class="form">
<form action="" method="">
<input class="cur" type="text" placeholder="your Name">
<input class="cur" type="text" placeholder="your Phone">
<input class="cur" type="email" placeholder="your Email" >
<textarea name="your Comment" id="" cols="30" rows="10" placeholder="Write Your Comment Here"></textarea>
<p><input class="submit" type="submit" value="SEND MESSAGE"></p>
</form>
</div>
</div>

<!-- About区域 -->
<div class="About">
<!-- 标题和简短描述 -->
<div class="about-title">
<h2>About</h2>
<p>分割线</P>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
</div>

<!-- 详细描述区 -->
<div class="about-desrciption">
<h3>A WORD<br /> ABOUT US</h3>
<p>Praesent dignissim viverra est, sed bibendum ligula congue non. Sed ac nisl et felis gravida commodo? Suspendisse eget ullamcorper ipsum. Suspendisse diam amet.</p>
<p>EXPLORE</p>
<img src="images/bb3.jpg" alt="">
<p>70000</p>
<p>分割线<br />Student</p>
<p>600</p>
<p>分割线<br />Faculty</p>
</div>
</div>

<!-- 图文混排区域 -->
<div class="word-img">
<div class="img-1"><img src="images/b1.jpg" alt="图片"></div>
<div class="word-2">
<h3>Library</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p>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>
<p>EXPLORE</p>
</div>
<div class="img-3"><img src="images/b2.jpg" alt="图片"></div>
<div class="word-4">
<h3>Library</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p>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>
<p>EXPLORE</p>
</div>
<div class="word-5">
<h3>Library</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p>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>
<p>EXPLORE</p>
</div>
<div class="img-6"><img src="images/b3.jpg" alt="图片"></div>
<div class="word-7">
<h3>Library</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p>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>
<p>EXPLORE</p>
</div>
<div class="img-8"><img src="images/b4.jpg" alt="图片"></div>

</div>

<!-- Gallery区域 -->
<div class="Gallery">
<!-- 标题 -->
<div class="G-title">
<h2>Gallery</h2>
<p>分割线</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting<br /> industry. Lorem Ipsum has been the industry's standard dummy<br /> text ever since the 1500s.
</p>
</div>

<!-- 简短描述 -->
<div class="G-description">
<dl>
<dt><img src="images/03-01.jpg" alt="图片"></dt>
<dd>Science Lab</dd>
</dl>
<dl>
<dt><img src="images/03-02.jpg" alt="图片"></dt>
<dd>Indoor Stadium</dd>
</dl>
<dl>
<dt><img src="images/03-03.jpg" alt="图片"></dt>
<dd>Transportation</dd>
</dl>
<dl>
<dt><img src="images/03-04.jpg" alt="图片"></dt>
<dd>Kids Room</dd>
</dl>
<dl>
<dt><img src="images/03-05.jpg" alt="图片"></dt>
<dd>Meditation Classes</dd>
</dl>
<dl>
<dt><img src="images/03-06.jpg" alt=图片""></dt>
<dd>Kids Play Ground</dd>
</dl>
</div>

</div>
<!-- Footer区域 -->
<div class="footer">
<p> &copy2016imooc.com 京ICP备13046642号</p>
</div>
</body>
</html>


写回答

1回答

好帮手慕慕子

2021-02-18

同学你好,效果是现实可以的,建议优化:可以使用组合选择器,将样式相同的代码书写在一起,简化代码书写,示例:

http://img.mukewang.com/climg/602dda8f097f72d606861428.jpg

http://img.mukewang.com/climg/602dda9e09db2ec907500472.jpg

祝学习愉快~


0

0 学习 · 15276 问题

查看课程