老师,这样写可以吗?
来源:2-7 编程练习
李小圆_
2019-07-26 16:41:28
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>CSS布局</title> <style type="text/css"> /*此处写代码*/ *{ padding: 0; margin: 0; } .container{ width: 850px; padding: 20px 30px; } .title{ font-size: 20px; font-weight: bold; font-family: '宋体'; text-align: center; margin-top: 10px; margin-bottom: 20px; } .content img{ width: 400px; display: block; } .content p{ width: 400px; } .content .content_left{ float: left; } .content .content_right{ float: right; } .clear{ clear: both; } </style> </head> <body> <!-- 此处写代码 --> <div class="container"> <div class="title">ENJOY THE LIFE</div> <div class="content"> <div class="content_left"> <img src="http://climg.mukewang.com/58f829090001a4b504260240.jpg" alt=""> <p>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.</p> </div> <div class="content_right"> <img src="http://climg.mukewang.com/58f8290f0001558804260240.jpg" alt=""> <p>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.</p> </div> <div class="clear"></div> </div> </div> </body> </html>
谢谢老师批改。
1回答
同学你好,老师运行了你的代码,效果是正确的,代码这样写也是可以的,继续努力哦~
如果我的回答帮助了你请采纳,祝学习愉快~
相似问题