老师 帮忙检查一下
来源:2-7 编程练习
lcy_18
2020-05-28 23:30:12
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS布局</title>
<style type="text/css">
/*此处写代码*/
*{
padding: 0;
margin: 0;
}
.main{
width: 1000px;
margin: 0 auto;
}
.main .main-top{
margin-top: 30px;
text-align: center;
margin-bottom: 10px;
}
.main .main-img .commen{
width: 50%;
float: left;
}
.main .main-img .commen div{
width: 426px;
padding-left:36px;
}
.main .main-img .commen img{
padding:0 36px;
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div class="main">
<div class="main-top">
<h2>ENJOY RHE LIFE</h2>
</div>
<div class="main-img">
<div class="commen">
<img src="http://climg.mukewang.com/58f829090001a4b504260240.jpg"/>
<div>Life is like a book,just more and more refined,more write more carefully.When read,mind open,all things have been indifferent to heart.Life is the precipitation.</div>
</div>
<div class="commen">
<img src="http://climg.mukewang.com/58f8290f0001558804260240.jpg"/>
<div>Life is like a book,just more and more refined,more write more carefully.When read,mind open,all things have been indifferent to heart.Life is the precipitation.</div>
</div>
</div>
</div>
</body>
</html>
1回答
同学你好,代码效果正确。继续加油,祝学习愉快~
相似问题