【问题标题】:DIV overflows outer DIV when IE window is reduced in size (Restore-Down)IE窗口缩小时DIV溢出外部DIV(Restore-Down)
【发布时间】:2015-01-31 19:47:05
【问题描述】:

我关注CSS 和HTML,它们可以很好地显示 DIV 的并行。但是当我减小 IE 窗口大小(restore-down)时,按钮控件会溢出根 DIV。有什么办法可以解决。基本上,即使用户减小页面窗口大小,我也希望 CSS 在根 div 中调整 DIV。

CSS

<style type="text/css">
 #root {
   background-color: #eee;
   width:100%;
 }

#left_side {
  float: left;
  padding-left: 10px;
  width:60%;
}

#right_side {
  float: Left;
  width: 40%;
  padding-right: 10px;
}
</style>

HTML

<div id="root" style="border:#04476F;border-color: #04476F; border-style: solid">      
  <div id="left_side">   Some Text here.     
  </div>       
  <div id="right_side">    
    <input type="submit" value="Submit your Request" />   
  </div>
</div>  

谢谢

【问题讨论】:

  • 请检查这个 SO 答案here

标签: html css asp.net internet-explorer styles


【解决方案1】:

工作jsFiddle

添加 div 位置,而不是将填充添加到内部 div,而是将其添加到容器中。

 #root {
   background-color: #eee;
   width:100%;
    padding:0 10px;
 }

#left_side {
  float: left;
  width:60%;
  position:relative;
}

#right_side {
  float: left;
  width: 40%;
  position:relative;
}

PS:另外,你在右边写了 position: Left;大写L。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-09
    • 2019-05-31
    • 1970-01-01
    • 1970-01-01
    • 2020-11-20
    • 1970-01-01
    相关资源
    最近更新 更多