IE和FF中的幻灯片放置位置太低

时间:2012-06-22 20:42:45

标签: html css html5 position

我有这个幻灯片,我试图简单地向上移动,但我无法正确定位它。现在有这个空白区域。有人可以帮我解决我出错的地方吗?只需在Firefox或IE中查看即可查看空格。它当然适用于Chrome,b / c一切都在chrome中运行。

http://modernd-i.com/

我尝试在css中使用位置,但在这些浏览器中它并没有让步。

3 个答案:

答案 0 :(得分:2)

看起来您正在使用表格进行布局。包含图片库的<td>的垂直对齐设置为vertical-align: baseline;,如果您将html中的内容更改为valign="top",它将使其正常工作。在Firefox中检查,而不是IE。

答案 1 :(得分:1)

在styles.css第4行中,你有:

...tfoot, thead, tr, th, td {
background: none repeat scroll 0 0 transparent;
border: 0 none;
margin: 0;
padding: 0;
vertical-align: baseline;   /* this is what is causing it */
}

将最后一个更改为:vertical-align: top

作为全球宣言的基线不是最好的主意,除非是故意的。

希望这有帮助。

答案 2 :(得分:0)

这应该有效:

#yourslideshow {
    position: relative;
    top: (-X)px;
 }

* - X表示像素数。

由于你没有jsfiddle,我无法确切地告诉你多少。但是如果你使用top,那就是你的幻灯片和页面顶部之间有多少像素。 (你也可以使用底部,而不是使用负值)。

离。

#yourslideshow {
    position: relative;
    bottom: (X)px;
 }

我知道你说你使用了位置,但我不确定你使用的是哪种类型的位置,因为你没有指明。

THEN

如果位置仍然不起作用,您可以尝试正边距顶部或负边距底部

#yourslideshow {
    position: relative;
    margin-bottom: (X)px;
 }

OR

#yourslideshow {
    position: relative;
   margin-top: (-X)px;
 }