请老师检查纠正,感觉自己实现的有问题

来源:2-7 编程练习

milulelele

2019-09-24 11:48:25

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8">  

  <title>CSS布局</title>

  <style type="text/css">

/*此处写代码*/

    *{

        margin:0;

        padding:0;

    }

 

    .con{

        width:1200px;

        text-align: center;

        position: absolute;

        left: 50%;

        margin-left: -600px;

    }

    .comm{

        float:left;

        width: 500px;

        padding: 20px;

    }

    img{

      width: 500px;

    }

  </style>

</head>

<body>

  <!-- 此处写代码 -->

  

  <div class="con">

    <div>ENJOY THE LIFE</div>

      <div class="comm">

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

          <div> inanimate matter, manifested in functions such as metabolism, growth, reproduction, and response to stimuli or adaptation to the environment originating from within the organism. b. The characteristic state or condition of </div>

      </div>

      <div class="comm">

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

          <div> inanimate matter, manifested in functions such as metabolism, growth, reproduction, and response to stimuli or adaptation to the environment originating from within the organism. b. The characteristic state or condition of </div>

      </div>

  </div>

</body>

</html>


写回答

1回答

好帮手慕粉

2019-09-24

同学你好,你的作业在布局上面是没有问题的,由于图片没有水平居中,所以看着会感觉不太对,可以把comm类样式的padding值调大一点

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

这样就好啦!

希望我的回答能够帮助到你,望采纳,祝学习愉快!

0

0 学习 · 40143 问题

查看课程