请老师检查代码是否正确
来源:2-17 自由编程
DanteSu
2021-08-15 00:57:54
<!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">
<title>Document</title>
<style>
*{
margin:0;
padding:0;
}
.main{
width: 100%;
}
.m1{
float: left;
width: 25%;
height: 380px;
margin-right:0;
}
img{
display: block;
width: 100%;
height: 100%;
}
.m2{
float: left;
width: 25%;
height: 380px;
background: #07cbc9;
position: relative;
}
.p1{
font-size: 24px;
padding-top: 20px;
margin-bottom: 30px;
padding-left: 20px;
}
.p2{
font-size: 16px;
color: white;
margin-bottom: 20px;
padding-left: 20px;
}
.p3{
font-size: 14px;
color:gray;
margin-bottom: 30px;
padding-left: 20px;
}
input{
display: block;
width: 138px;
height: 40px;
border: none;
color: white;
background-color: black;
line-height: 40px;
margin: 0 auto;
}
.top::before{
content: "";
width: 0;
height: 0;
border: 20px solid transparent;
border-right-color: #07cbc9;
top: 170px;
right: 100%;
position: absolute;
}
.bottom::before{
content: "";
width: 0;
height: 0;
border: 20px solid transparent;
border-left-color: #07cbc9;
top: 170px;
left: 100%;
position: absolute;
}
</style>
</head>
<body>
<div class='main'>
<div class="m1">
<img src="./images/b1.jpg" alt="">
</div>
<div class="m2 top">
<p class="p1">Library</p>
<p class="p2">Lorem Ipsum is simply dummy text of the printing and typesetting
industry</p>
<p class="p3">
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>
<input type="submit" value="EXPLORE">
</div>
<div class="m1">
<img src="./images/b2.jpg" alt="">
</div>
<div class="m2 top">
<p class="p1">Library</p>
<p class="p2">Lorem Ipsum is simply dummy text of the printing and typesetting
industry</p>
<p class="p3">
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>
<input type="submit" value="EXPLORE">
</div>
<div class="m2 bottom">
<p class="p1">Library</p>
<p class="p2">Lorem Ipsum is simply dummy text of the printing and typesetting
industry</p>
<p class="p3">
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>
<input type="submit" value="EXPLORE">
</div>
<div class="m1">
<img src="./images/b3.jpg" alt="">
</div>
<div class="m2 bottom">
<p class="p1">Library</p>
<p class="p2">Lorem Ipsum is simply dummy text of the printing and typesetting
industry</p>
<p class="p3">
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>
<input type="submit" value="EXPLORE">
</div>
<div class="m1">
<img src="./images/b4.jpg" alt="">
</div>
</div>
</body>
</html>
1回答
樱桃小胖子
2021-08-15
同学你好,建议对代码进行一下优化,相同的代码合并书写,这样不仅能提升代码质量,还能提升编码效率。参考如下:
希望可以帮到你,祝学习愉快!
相似问题