【问题标题】:Float Left without going through another DIV [closed]在不经过另一个 DIV 的情况下向左浮动 [关闭]
【发布时间】:2013-10-29 13:20:59
【问题描述】:

我正在尝试向我的网站添加侧边栏。 我一直在尝试创建一个div,它将用作菜单,代码如下:

      <div style="">
          <div style="display:inline;width:70%;">
                hey
           </div>
           <div style="float:left;width:20%;">
               <div style="background-color:#F2F2F2;font-weight:bold;padding:7px;">Title</div>
               text<br /><br />f
           </div>
       </div>

然后,我得到了以下结果:

侧边栏通过另一个div,不作为个人div

【问题讨论】:

    标签: html css css-float


    【解决方案1】:

    您需要清除浮动来解决此问题。

    例如,在您的情况下,

    <div style="clear:left;">&nbsp;</div>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-25
      • 1970-01-01
      • 2017-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多