麻烦老师看下是否还有可优化项
来源:4-10 自由编程
Bailey_
2021-03-23 10:38:26
相关代码:
<!-- 图文混排区域 -->
<div class="pic-word">
<!-- 图片1 -->
<div class="img">
<img src="images/b1.jpg" alt="">
</div>
<!-- 文字1 -->
<div class="text">
<h2>Library</h2>
<p class="part1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="part2">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="">
<input class="submit" type="submit" value="EXPLORE">
</a>
</div>
<!-- 图片2 -->
<div class="img">
<img src="images/b2.jpg" alt="">
</div>
<!-- 文字2 -->
<div class="text">
<h2>Library</h2>
<p class="part1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="part2">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="">
<input class="submit" type="submit" value="EXPLORE">
</a>
</div>
<!-- 文字3 -->
<div class="text">
<h2>Library</h2>
<p class="part1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="part2">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="">
<input class="submit" type="submit" value="EXPLORE">
</a>
</div>
<!-- 图片3 -->
<div class="img">
<img src="images/b3.jpg" alt="">
</div>
<!-- 文字4 -->
<div class="text">
<h2>Library</h2>
<p class="part1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="part2">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="">
<input class="submit" type="submit" value="EXPLORE">
</a>
</div>
<!-- 图片4 -->
<div class="img">
<img src="images/b4.jpg" alt="">
</div>
</div>
相关代码:
* {
padding: 0;
margin: 0;
}
/* 去掉所有列表的小圆点 */
ul,ol {
list-style: none;
}
/* 去掉所有超级链接的下划线 */
a {
text-decoration: none;
}
/* 图文混排区域 */
.pic-word {
width: 100%;
height: 760px;
}
.pic-word .img {
float: left;
width: 25%;
}
.pic-word .img img {
display: block;
width: 100%;
height: 380px;
}
.pic-word .text {
float: left;
width: 25%;
height: 380px;
background-color: #07cbc9;;
}
.pic-word .text h2 {
font-size: 24px;
color: white;
margin: 20px 0 30px 20px;
}
.pic-word .text .part1 {
font-size: 16px;
color: white;
margin-left: 20px;
}
.pic-word .text .part2 {
font-size: 14px;
color: gray;
margin-left: 20px;
margin-top: 20px;
}
.pic-word .text a .submit {
width: 138px;
height: 40px;
background-color: #000;
color: white;
display: block;
margin: 30px auto;
font-size: 18px;
}
1回答
同学你好,效果实现是对的,代码也很简洁,有一处可以再优化下,由于input元素有默认的边框样式,效果不美观,如下图所示:

建议:使用border属性设置边框样式

祝学习愉快~
相似问题
回答 1