【问题标题】:Difference in css position IE/FF, how to solv my problem?css位置IE/FF的差异,如何解决我的问题?
【发布时间】:2011-02-19 01:14:08
【问题描述】:

我制作了一些 div,它在 Firefox 中按预期工作。

但不是在 Internet Explorer 8 中。

有人有小费吗?

结构是这样的:

<div id="imgntxt">

    <div id="imgntxtImg">

        <div id="imgntxtNav1"></div>
        </div>

    <div id="imgntxtText">text</div>

</div>

imgContainer 通过一些 javascript 魔术获取图像作为背景。

css:

#imgntxt
{   
    padding: 2px;

    width: 200px;
}

#imgntxtImg
{
    position: relative;
}

#imgntxtText
{
}

#imgntxtNav1, #imgntxtNav2
{
    position: absolute;

    right: 2px;

    bottom: 0;

    background: transparent url("next.png") no-repeat top left;

    height: 16px;
    width: 16px;
}

#imgntxtNav2
{
    right: 19px;

    background: transparent url("prev.png") no-repeat top left;
}

【问题讨论】:

  • 你能把问题的标题改成IE吗?谢谢。
  • 包含您的 CSS 代码将大大有助于人们为您提供帮助。
  • 请尝试使用jsbin.com 或其他提供商来展示演示。这将比仅在 yfrog 中查看图像有很多好处。!

标签: css browser cross-browser


【解决方案1】:

我可以 100% 确定,因为您添加的代码量并不完整,但我认为它在发挥您的作用:绝对在 #imgntxtNav1、#imgntxtNav2 中。 如果我错了,请提供更多细节。

【讨论】:

    【解决方案2】:

    您是否尝试将图像定位在顶部而不是底部?

    #imgntxtNav1, #imgntxtNav2
    {
      position: absolute;
      right: 2px;
      top: 0;
      ...
    }
    

    另外,为什么不直接将导航的图片放在html中呢?
    这听起来不仅更容易,而且更正确。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-01
      • 1970-01-01
      • 2012-07-05
      • 2018-08-06
      • 2010-10-20
      • 1970-01-01
      • 2015-04-21
      相关资源
      最近更新 更多