• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
成为自己最想成为的那种人
博客园    首页    新随笔    联系   管理    订阅  订阅
CSS——标准盒子模型

在写网页的时候一般都先用Div把网页的框架搭好(用不同的背景颜色来区分不同的Div块),然后填充每一个Div,最后把每个Div的背景颜色去掉

    <html>

      <head>

        <title></title>

        <style type="text/css">

          .divIndex

          {
            width:1000px;height:800px;background-color:yellow;margin:0px auto;
          }
          .divLogo
            { width:1000px;height:100px;background-color:red;
          }
          .divContent
          {
            width:1000px;height:300px;background-color:Green;
          }
          .divPicture
          {
            height:300px;width:300px;background-color:Blue;float:left;
          }
          .divText
          {
            height:300px;width:700px;background-color:Purple;float:left;
          }

 

        </style>

      </head>

      <body>

        <div class="divIndex">

          <div class="divLogo">
            <img src="image/000.jpg" height="100px" alt="姊妹"/>
          </div>
          <div class="divContent">
            <div class="divPicture"></div>
            <div class="divText"></div>
          </div>

        </div>

      </body>

    </html>

posted on 2017-05-04 00:21  遇见未来  阅读(435)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3