请老师看看这样实现可不可以? 谢谢!

来源:2-7 编程练习

Cloud_轩

2020-11-17 10:26:24

# 具体遇到的问题

# 报错信息的截图

# 相关课程内容截图

# 尝试过的解决思路和结果

# 粘贴全部相关代码,切记添加代码注释(请勿截图)

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8">

<title>CSS布局</title>

<style type="text/css">

*{

margin: 0;

padding: 0;

}

h1{text-align: center;}

h1,dd{font-style: "微软雅黑";}

div,h1{

width: 1000px;

margin: 0 auto;

}

dl{

width: 425px;

float: left;

}

.intro1{

margin-right: 25px;

margin-left: 50px;

}

.intro2{margin-left: 25px;}

dd{font-weight: bold;}

</style>

</head>

<body>

<h1>ENJOY YHE LIFE</h1>

<div>

<dl class="intro1">

<dt>

<img src="http://climg.mukewang.com/58f829090001a4b504260240.jpg" />

</dt>

<dd>Life is like a book, just read more and more refined, more write more carefully. When read, mind open, all things have been indifferent to heart. Life is the precipitation.</dd>

</dl>

<dl class="intro2">

<dt>

<img src="http://climg.mukewang.com/58f8290f0001558804260240.jpg" />

</dt>

<dd>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.</dd>

</dl>

</div>

</body>

</html>


写回答

1回答

好帮手慕码

2020-11-17

同学你好,代码效果实现的可以。不过关于边距和居中,可以再优化:

http://img.mukewang.com/climg/5fb3392209aee57504050480.jpg

祝学习愉快~

0

0 学习 · 40143 问题

查看课程