为了账号安全,请及时绑定邮箱和手机立即绑定

边距的问题,哪位大神帮忙看一下?

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>无标题文档</title>

<style type="text/css">

*{margin:0;padding:0;}

#wrap{width:770px;margin:0 auto;}

#top{width:100%;height:100px;border:1px solid red;}

#mybody{width:100%;height:500px;border:1px solid blue;}

#foot{width:100%;height:200px;border:1px solid green;}

img{margin:10px 18px;border:1px solid #999;}

.content{border:4px solid #def4f5;padding:74px 15px;width:770px;}

.book{background:url(../%E7%BD%91%E9%A1%B5%E5%B8%83%E5%B1%80%E5%9F%BA%E7%A1%80/case2/images/t_book.gif) no-repeat #def4f5;}

</style>

</head>


<body>

  <div id="wrap">

    <div id="top"></div>

    <div id="mybody">

      <div class="content book">

        <img src="../网页布局基础/case2/images/book1.jpg" width="80" height="80" alt=""/>

        <img src="../网页布局基础/case2/images/book2.jpg" width="80" height="80" alt=""/>

        <img src="../网页布局基础/case2/images/book3.jpg" width="80" height="80" alt=""/>

        <img src="../网页布局基础/case2/images/book4.jpg" width="80" height="80" alt=""/>

        <img src="../网页布局基础/case2/images/book5.jpg" width="80" height="80" alt=""/>

      </div>

    </div>

    <div id="foot"></div>

  </div>

</body>

</html>


正在回答

2 回答

一楼正确,本身有border和padding,宽度要设只能设置732。要么就不设或auto

0 回复 有任何疑惑可以回复我~

第13行,width:770px 改成 width:auto 你试下

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
网页布局基础
  • 参与学习       214749    人
  • 解答问题       1756    个

让你精通CSS中三大定位机制,彻底掌握网页布局的相关知识

进入课程

边距的问题,哪位大神帮忙看一下?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信