代码可以么请问
来源:2-17 自由编程
慕斯3525401
2020-11-16 13:17:13
<!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区域 -->
<header>
<div class="header-top">
<div class="logo">
<img class="logo_img" src="images/logo.png" alt="">
</div>
<nav class="navigate">
<ul>
<li>HOME</li>
<li>ABOUT</li>
<li>GALLERY</li>
<li>FACULTY</li>
<li>EVENTS</li>
<li>CONTACT</li>
</ul>
</nav>
</div>
</header>
<!-- Banner区域 -->
<div class="banner">
<div class="image">
<img src="images/banner3.jpg" alt="">
</div>
<div class="mask"></div>
<div class="form">
<form action="" method="post">
<input class="form_info" type="text" placeholder="your Name">
<input class="form_info" type="password" placeholder="your Password">
<input class="form_info" type="email" placeholder="your Email">
<textarea class="form_info" placeholder="Write Your Comment Here" rows="5" cols="50"></textarea>
<!-- <button type="submit">SEND MESSAGE</button> -->
<input class="form_info" type="submit" value="SEND MESSAGE">
</form>
</div>
</div>
<!-- About区域 -->
<div class="about">
<div class="About-top">
<div class="about-headline">
<h2>ABOUT</h2>
</div>
<div class="sep"></div>
<div class="about-brief">
<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>
<div class="About-bottom">
<div class="About-bottom-left">
<h3>A WORD<br>ABOUT US</h3>
<div class="About-bottom-1">
<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>
<span>EXPLORE</span>
</div>
</div>
<div class="About-bottom-2">
<img src="images/bb3.jpg" alt="">
</div>
<div class="About-bottom-right">
<div class="About-bottom-3">
<p>70000</p>
<div class="sep"></div>
<span>students</span>
</div>
<div class="About-bottom-4">
<p>600</p>
<div class="sep"></div>
<span>Faculty</span>
</div>
</div>
</div>
</div>
<!-- 图文混排区域 -->
<div class="imageAndText-mix">
<div class="image-1">
<img src="images/b1.jpg" alt="">
</div>
<div class="text text-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>
<span>EXPLORE</span>
</div>
<div class="image-3">
<img src="images/b2.jpg" alt="">
</div>
<div class="text text-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>
<span>EXPLORE</span>
</div>
<div class="text text-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>
<span>EXPLORE</span>
</div>
<div class="image-6">
<img src="images/b3.jpg" alt="">
</div>
<div class="text text-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>
<span>EXPLORE</span>
</div>
<div class="image-8">
<img src="images/b4.jpg" alt="">
</div>
</div>
<!-- Gallery区域 -->
<div class="gallery about">
<div class="gallery-top About-top">
<div class="gallery-headline about-headline">
<h2>GALLERY</h2>
</div>
<div class="sep"></div>
<div class="gallery-brief">
<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>
<div class="gallery-bottom">
<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区域 -->
<footer>
<div class="copyright">
<p>©2016 imooc.com 京ICP备13046642号</p>
</div>
</footer>
</body>
</html>
CSS:
* {
padding:0;
margin:0;
}
ul,ol{
list-style: none;
}
/* 分割线 */
.sep{
width: 60px;
height: 3px;
background: #07cbc9;
margin:10px auto;
}
/* header区域 */
header{
width:100%;
height:80px;
background-color: #07cbc9;
}
header .header-top{
margin:0 auto;
overflow: hidden;
width:1200px;
}
header .header-top .logo{
float:left;
padding:16px 0;
}
header .header-top .logo .logo_img{
display: block;
}
header .header-top .navigate{
float:right;
}
header .header-top .navigate ul li{
float: left;
margin-right:20px;
text-align: center;
line-height: 80px;
font-size: 16px;
color:white;
}
/* banner区域 */
.banner{
position: relative;
}
.banner .image img{
width: 100%;
display: block;
height:600px;
}
.banner .mask{
background:rgba(0, 0, 0, 0.5);
height:600px;
width:100%;
position: absolute;
top:0;
}
.banner .form{
position: absolute;
top:100px;
left:50%;
margin-left:-252px;
width:508px;
text-align:center;
}
.banner .form input{
height:40px;
margin-bottom: 20px;
}
.banner .form input:last-child{
width: 200px;
height:40px;
}
.banner .form .form_info{
background: none;
width: 504px;
color:#808080;
border-color:#808080;
border-style:solid;
}
.banner .form textarea{
height:110px;
margin-bottom: 20px;
}
/* about区域 */
.about{
width:1200px;
margin:0 auto;
margin-top: 30px;
}
.about .About-top{
text-align: center;
}
.about .About-top .about-headline{
font-size: 32px;
}
.about .About-top .about-brief{
color:gray;
font-size: 14px;
}
.about .About-bottom{
width:1200px;
height: 464px;
position: relative;
overflow: hidden;
}
.about .About-bottom .About-bottom-left{
float:left;
}
.about .About-bottom h3{
font-size: 30px;
margin-top: 33px;
}
.about .About-bottom .About-bottom-2{
position: absolute;
left:50%;
margin-left:-325px;
margin-top: 30px;
}
.about .About-bottom .About-bottom-2 img{
width:650px;
height: 435px;
display: block;
}
.about .About-bottom .About-bottom-1{
width:300px;
padding:20px;
font-size:18px;
border:1px solid gray;
background: rgba(255,255,255,0.5);
position: absolute;
top:140px;
left:0;
z-index: 99;
}
.about .About-bottom .About-bottom-1 span{
width: 140px;
height: 40px;
color:white;
font-size: 20px;
display: block;
background-color: black;
text-align: center;
line-height: 40px;
margin-top: 20px;
}
.about .About-bottom .About-bottom-right{
float: right;
width: 260px;
}
.about .About-bottom .About-bottom-3,.about .About-bottom .About-bottom-4{
padding:40px 0;
border:1px solid #07cbc9;
text-align: center;
margin-top: 30px;
}
.about .About-bottom .About-bottom-3 p,.about .About-bottom .About-bottom-4 p{
font-weight: bold;
font-size: 28px;
}
/* 混排区域 */
.imageAndText-mix{
width:100%;
height:760px;
margin-top:18px;
}
.imageAndText-mix div{
width:25%;
height:380px;
float: left;
}
.imageAndText-mix div img{
display: block;
height:380px;
width:100%;
}
.imageAndText-mix .text{
background-color: #07cbc9;
position: relative;
}
.imageAndText-mix .text:nth-child(2n+2)::before{
content:'';
width:0;
height: 0;
position: absolute;
border:20px solid transparent;
border-right-color: #07cbc9;
top:170px;
margin-top: -20px;
left:-40px;
}
.imageAndText-mix .text:nth-child(2n+5)::after{
content:'';
width:0;
height: 0;
position: absolute;
border:20px solid transparent;
border-left-color: #07cbc9;
top:170px;
margin-top: -20px;
right:-40px;
}
.imageAndText-mix .text h3{
font-size: 24px;
color:white;
margin:20px 0 30px 20px;
}
.imageAndText-mix .text p{
margin-left: 20px;
margin-bottom: 20px;
font-size: 16px;
color: white;
}
.imageAndText-mix .text p:last-of-type{
margin-bottom: 30px;
font-size: 14x;
color:gray;
}
.imageAndText-mix .text span{
display: block;
width: 138px;
height: 40px;
background-color: black;
line-height: 40px;
text-align: center;
color: white;
margin:0 auto;
}
/* gallery区域 */
.gallery-bottom{
width: 1160px;
height: 653px;
padding: 0 20px;
margin: 0 auto;
overflow: hidden;
}
.gallery-bottom img{
display: block;
width: 360px;
height: 240px;
}
.gallery-bottom dl{
float: left;
margin-right: 40px;
margin-top: 30px;
}
.gallery-bottom dl:nth-child(3n){
margin-right: 0;
}
.gallery-bottom dl dd{
width: 340px;
height: 50px;
background-color:black;
color:white;
line-height: 50px;
padding-left:20px;
}
/* 页脚区域 */
footer .copyright{
width: 100%;
height: 80px;
background-color: #07cbc9;
text-align: center;
line-height: 80px;
margin-top: 30px;
}
1回答
同学你好,三角写的不错,有个问题需要优化:三角形垂直方向没有居中显示:
原因是top值设置的不合理,修改如下:
另外,font-size属性值,单位是px,如下位置写错了:
祝学习愉快!
相似问题