【问题标题】:IE8 positioning, nightmare!IE8定位,噩梦!
【发布时间】:2010-03-25 21:51:07
【问题描述】:

你好,你猜怎么着,我有一个 IE 定位问题!这是8,所以上帝知道其他版本发生了什么(稍后检查)

两个盒子都叫同一个类,为什么IE这么难?

它的外观如下:

它的外观是这样的:

CSS:(为了便于阅读,去掉了 cmets)

div .roundbigboxkunde {
    background-image:url(../../upload/EW_kunde_info.png);
    background-position:top center;
    padding:10px;
    padding-top:10px;
    padding-bottom:20px;
    width:560px;
    height:1%;
    border-width:1px;
    border-color:#dddddd;
    border-radius:10px;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    z-index:1;
    position:relative;
    overflow:hidden;


}

div .roundbigboxkundei {

    margin-top:10px;
    padding:10px;
    padding-top:10px;
    padding-bottom:10px;
    width:760px;
    height:1%;
    position:relative;
    overflow:hidden;

还有 HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

    <div class="roundbigboxkunde"> 
    <div class="roundbigboxkundei"> 

<p id="nyk">&nbsp;</p> 
<div id="bg_box2"></div> 
<p class="required"> 

       <label for="billing_firstName"><span class="label">Fornavn:</span></label> 
       <fieldset class="error"><input name="billing_firstName" class="text" type="text" value="Kyle"/> 

    <div class="errorText hidden"></div> 
    </fieldset> 
</p> 

CONTENT CONTINUES

        </fieldset> 

Here is the page

【问题讨论】:

标签: html css internet-explorer-8 positioning


【解决方案1】:

鉴于您的某些内容看起来像是出现在其他内容中,如果我是您,我会首先仔细检查您的所有标签是否已关闭(即,您没有缺少 &lt;div&gt;它的&lt;/div&gt;)。

但是从你发布的内容很难判断。 . .如果页面托管在某个地方并且您可以链接到它,那将更容易调试。

【讨论】:

  • 而且问题是,它在除 IE 之外的所有浏览器中都能正常工作,我应该只更改 IE CSS 中的一些设置(已经使用 cond.cmets)还是其他什么?整天用头撞它。
  • 这取决于.... IE 有时会因为 IE 不符合 CSS 标准而出现问题(尽管根据我的经验,IE 8 在基本 CSS 合规性方面比以前的版本要好得多 - 不是那样的说了很多)。在这种情况下,当然,您可以在条件注释中添加一些新的 CSS。在其他时候,虽然可能是你犯了一个真正的错误——比如我建议你可能缺少一个结束标签——只是你正在测试的其他浏览器在猜测你的内容方面做得更好意思说。在这种情况下,您需要真正修复该错误。
  • 好的,谢谢蒂姆,我会用细齿电子梳检查一遍。
【解决方案2】:

我补充说:

<div class="clear"></div>

用css:

.clear
{
    clear: both;
    width: 100%;
    height: 0;
    overflow: hidden;
    float: none !important;
}

在两个盒子之间。把它修好了:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-21
    • 2020-03-14
    • 2010-11-13
    • 2010-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多