请老师检查一下我的代码有没有什么需要修改的地方,谢谢~
来源:2-17 自由编程
lascride
2021-04-29 16:02:05
<!-- 图文混排区域 -->
<!-- Img&text -->
<section class="img-text">
<div class="img">
<img src="./images/b1.jpg" alt="">
</div>
<div class="text texta">
<h3>Library</h3>
<p class="p1">
Lorem Ipsum is simply dummy text of the printing and typesetting industry
</p>
<p class="p2">
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 href="">EXPLORE</a>
</div>
<div class="img">
<img src="./images/b2.jpg" alt="">
</div>
<div class="text texta">
<h3>Library</h3>
<p class="p1">
Lorem Ipsum is simply dummy text of the printing and typesetting industry
</p>
<p class="p2">
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 href="">EXPLORE</a>
</div>
<div class="text textb">
<h3>Library</h3>
<p class="p1">
Lorem Ipsum is simply dummy text of the printing and typesetting industry
</p>
<p class="p2">
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 href="">EXPLORE</a>
</div>
<div class="img">
<img src="./images/b3.jpg" alt="">
</div>
<div class="text textb">
<h3>Library</h3>
<p class="p1">
Lorem Ipsum is simply dummy text of the printing and typesetting industry
</p>
<p class="p2">
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 href="">EXPLORE</a>
</div>
<div class="img">
<img src="./images/b4.jpg" alt="">
</div>
</section>
/* 图文混排区域 */
.img-text {
width: 100%;
margin-top: 20px;
}
.img-text div {
width: 25%;
height: 380px;
background-color: #07cbc9;
float: left;
}
.img-text .img img {
height: 100%;
width: 100%;
}
.img-text .text {
position: relative;
}
.img-text .texta::before {
content:' ';
width: 0;
height: 0;
border: 20px solid transparent;
border-right-color: #07cbc9;
position: absolute;
/* top: 50%; */
/* left: -90px; */
top: 190px;
margin-top: -10px;
left: -40px;
}
.img-text .textb::after {
content:' ';
width: 0;
height: 0;
border: 20px solid transparent;
border-left-color: #07cbc9;
position: absolute;
/* top: 50%; */
/* left: -90px; */
top: 190px;
margin-top: -10px;
right: -40px;
}
.img-text .text h3 {
font-size: 24px;
color: white;
margin-bottom: 30px;
margin-top: 20px;
margin-left: 20px;
}
.img-text .text .p1 {
margin-left: 20px;
margin-top: 30px;
margin-bottom: 30px;
font-size: 16px;
color: #fff;
}
.img-text .text .p2 {
color: gray;
margin-left: 20px;
font-size: 14px;
margin-bottom: 30px;
}
.img-text .text a {
display: block;
width: 138px;
height: 40px;
background-color: #000;
color: white;
line-height: 40px;
text-align: center;
margin: 0 auto;
}
1回答
同学你好,代码实现效果还可以,基本没问题,存在以下几处细节建议优化一下,如图
祝学习愉快!
相似问题
回答 1
回答 1
回答 1
回答 1
回答 1