IE无法在同一页面上正确显示相同的代码两次

时间:2010-07-02 06:46:20

标签: internet-explorer

哎呀,好吧。我有一段代码可以重复两次。但它不显示相同,它在同一页面上。我已经检查过所有内容与html和CSS相同。我真的无法绕过这个。此代码是joomla模块的一部分。我必须注意,这不是我的代码!!!但我必须解决它..

    <div class="user123content">
 <div class="firstDiv">
            <div class="secondDiv">

                <div class="thirdDiv">
                    <div style="float: left; width: 171px; text-align: center;"> 
                        <div>
                            <span style="font-weight: bold;">Product</span>
                            <br>
                            <br>
                            <a href="#">
                                <img height="150" border="0" width="116" alt="Product des" src="img.jpg"></a>
                                <br>
                        </div>
                        <span class="productPrice">
                                111 $ 
                        </span>
                        <br>
                        <span></span>
                    </div>
                </div>

                <div class="thirdDiv">
                    <div style="float: left; width: 171px; text-align: center;"> 
                        <div>
                            <span style="font-weight: bold;">Product</span>
                            <br>
                            <br>
                            <a href="#">
                                <img height="150" border="0" width="116" alt="Product des" src="img.jpg"></a>
                                <br>
                        </div>
                        <span class="productPrice">
                                111 $ 
                        </span>
                        <br>
                        <span></span>
                    </div>
                </div>

                <div class="thirdDiv">
                    <div style="float: left; width: 171px; text-align: center;"> 
                        <div>
                            <span style="font-weight: bold;">Product</span>
                            <br>
                            <br>
                            <a href="#">
                                <img height="150" border="0" width="116" alt="Product des" src="img.jpg"></a>
                                <br>
                        </div>
                        <span class="productPrice">
                                111 $ 
                        </span>
                        <br>
                        <span></span>
                    </div>
                </div>

            </div>
        </div>
    </div>

和CSS:

    .thirdDiv {
 float: left;
 width: 176px;
 height: 240px;
    }

包含所有550 px宽的div

2 个答案:

答案 0 :(得分:0)

使用FireBug找出原因。

也许第二次它嵌套在另一个div中,并且有一个样式:

.otherDiv .thirdDiv {
    width: 300px; /* override width */
}

答案 1 :(得分:0)

我复制了你的代码并在本地进行了测试,没有问题。所有三个框都显示为水平平铺。我会仔细检查你的css规则是否都没有干扰任何预先插入的Joomla规则或反过来...我在5种不同的浏览器(ie8,chrome,ff,opera,safari)上测试过,同样的每个人的结果。