请老师检查代码
来源:2-7 编程练习
pine小松
2020-03-13 13:19:22
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS布局</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
dl{
width:800px;
height:500px;
margin:0 auto;
text-align:center;
}
dt{
font-size:20px;
font-weight:bold;
}
.smacon1,.smacon2{
width:390px;
height:300px;
float: left;
overflow:hidden;
}
.word{
font-size: 12px;
font-weight:bold;
text-align: left;
}
.pic{
width:390px;
height:240px;
}
.smacon2{
margin-left:20px;
}
</style>
</head>
<body>
<dl>
<dt>ENJOY THE LIFE</dt>
<dd>
<div class="smacon1">
<div class="pic"><img src="http://climg.mukewang.com/58f829090001a4b504260240.jpg"></div>
<div class="word">Life is like a bank, just read more and more refined more write and more carefully.When read mind open, all things have been indifferent to heart. Life is the precipitation.</div>
</div>
</dd>
<dd>
<div class="smacon2">
<div class="pic"><img src="http://climg.mukewang.com/58f8290f0001558804260240.jpg"></div>
<div class="word">Life is like a cup of tea, let people lead a person to endless aftertastes. You again good taste, it will always have a different taste, different people will have different taste more.</div>
</div>
</dd>
</dl>
</body>
</html>
1回答
同学你好,代码布局以及实现效果很棒。继续加油,祝学习愉快!
相似问题