DIV内的DIV有溢出:隐藏?

时间:2011-10-24 14:16:07

标签: css

这里有点头疼,所以任何指针都会非常感激!

我有一个标题div,其属性为overflow:hidden。此标题的左侧是页面标题,右侧是许多图像。这非常有效,一切都显示出来。

但是,我现在需要将这些图像包装在div标签周围(它们将变为可点击,并通过Ajax更新 - 所以我需要为每个图像定义回发div)。如上所述,如果不将图像包裹在div标签周围,它们就会显示出来。但是,只要我添加div标签,它们就会消失(尽管仍然显示在页面源中)。 div标签采用简单的形式,没有样式与它们相关联。

我确定我在这里遗漏了一些东西,但是对于我的生活来说,它现在完全绕过了我!

谢谢: - )

1 个答案:

答案 0 :(得分:0)

如果我理解你的问题,你的问题对我来说有点不清楚

如果您需要点击事件,可以使用asp:ImageButton来保存图片。 如果你真的需要使用div

<div class="header"> // this is the one with overflow hiddden
<div class="left"> // this div holds the page title ; float:left
<h1>Title</h1>
</div>

<div class="right"> // this div to hold the divs which contain images
                    // if all your images are same height set the same height to this div and float:right
    <div class="image"> // this div holds the image; make float:left set height and width
        <img/>
    </div>
    <div class="image">
        <img />
    </div>
    <div class="image">
        <img />
    </div>
</div>

</div>

希望这有帮助