2-13混合布局编程练习

2-13混合布局编程练习

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>混合布局2-13编程练习</title>
    <style type="text/css">
        body{margin:0;
          padding:0;
          }
        .container{width:800px;
                   height:220px;
                   background:rgb(173,216,230);
                   margin:0 auto;
                   padding:10px 100px;
                   }
        .image1{width:350px;
               height:190px;
               float:left;
               margin-top:10px;}
        .image2{width:350px;
               height:190px;
               float:right;
               margin-top:10px;}
        .footer{width:800px;
               height:120px;
               background:rgb(255,182,193);
               margin:0 auto;
               padding:10px 100px;
             }
        .left{width:200px;
              height:100px;
              float:left;
              margin-right:100px;
              margin-top:10px;}              
        .center{width:200px;
              height:100px;
              float:left;
              margin-top:10px;
            }                     
        .center{width:200px;
              height:100px;
              float:right;
              margin-top:10px;}          
    </style>
</head>
<body>
    <div class="container">
         <div class="image1">
         <img src="http://img1.sycdn.imooc.com/climg//58c0f808000129a303600215.jpg" alt="image1" width="350px" height="190px"/>
         </div>
         <div class="image2">
          <img src="http://img1.sycdn.imooc.com/climg//58c0f819000198a703600214.jpg" alt="image2" width="350px" height="190px"/>
          </div>
    </div>
    <div class="footer">
        <div class="left">
        <img src="http://img1.sycdn.imooc.com/climg//58c0f81d0001fe4402000060.jpg" alt="image" width="200px" height="100px"/>    
        </div>
        <div class="center">
            <img src="http://img1.sycdn.imooc.com/climg//58c0f8220001dfce02000060.jpg" alt="image" width="200px" height="100px"/>
        </div>
        <div class="right">
            <img src="http://img1.sycdn.imooc.com/climg//58c0f8780001c74602000060.jpg" alt="image" width="200px" height="100px"/>
        </div>
    </div>
</body>
</html>

可以运行一下吗,为啥粉色部分的第二张图片和其他两张距离外面盒子的高度不一样呢

正在回答

登陆购买课程后可参与讨论,去登陆

1回答

http://img1.sycdn.imooc.com/climg//59ca2a900001cef106410484.jpg

这里改成right,你的代码中写了两个center。注意要细心一点。祝学习愉快!

  • 慕丝740390 提问者 #1
    好的,谢谢老师
    2017-09-26 22:56:08
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师