【问题标题】:multiple divs not expanding to adjust to dynamic content IE多个 div 不扩展以适应动态内容 IE
【发布时间】:2011-08-10 23:39:05
【问题描述】:

我一直在为这个 CSS 问题苦苦挣扎,但网上似乎没有任何答案对我有用(过去几天我读了这么多帖子)。

我遇到的问题是三个 div 包含动态内容,并且随着内容的增长(内容在开始时隐藏,然后通过单击每个部分增长的标题用 Jquery 显示)div 会无法像在其他所有浏览器(包括 FF 3.0)中那样正确展开。

我已经尝试过 min-height、overflow:auto、overflow:hidden、height:100% 等一切。使用溢出:自动,我得到滚动条,并且只有一个 div 在滚动条内正确调整。使用溢出:隐藏内容只是隐藏,呵呵。然后 min-height 和 height 什么也没做,只是让内容溢出。

这是三个 div 的 CSS:

// outher div, it's floating left next to a leftbar
div#conwrap {
  background: #C0E7F4;
  width: 810px;
  margin: 0;
  float: left;
}

/* For 2 column layout */
div#main_wide {
    margin: 20px 20px 20px 20px;
}

// Inner div. The main one I want to expand.
div.round {
  -moz-border-radius-topleft:15px;
  -moz-border-radius-topright:15px;
  -moz-border-radius-bottomleft:15px;
  -moz-border-radius-bottomright:15px;
  -webkit-border-top-left-radius:15px;
  -webkit-border-top-right-radius:15px;
  -webkit-border-bottom-left-radius:15px;
  -webkit-border-bottom-right-radius:15px;
  background: #fff;
  padding: 10px;
  margin: 0 0 0px 0;
}

然后是 div.round 内内容的 html:

/* Block for education details */
<h3 class="edit_type" id="education">Education</h3> 
<ul>...</ul>
<div class="clear"></div>

/* Block for account details */  
<h3 class="edit_type" id="account">Account</h3>
<ul>...</ul>
<div class="clear"></div>

等等……(还有三个块)

使用Jquery,所有的uls在开头隐藏,然后点击h3时显示或隐藏。

有什么帮助吗?? 非常感谢!!!!!!

【问题讨论】:

    标签: jquery html css internet-explorer


    【解决方案1】:

    height:auto; 指定为可能有帮助的内部 div。

    【讨论】:

    • 可以把内容贴在ul里面吗?
    • 当然!例如,“帐户”块具有:
    • {{ profile.preferred_email }} 更改电子邮件{{ profile_edit_form.email_private }}保持私密以登录并接收通知
    猜你喜欢
    相关资源
    最近更新 更多
    热门标签