【问题标题】:Hover over thumbnails with absoloute position in IE将鼠标悬停在 IE 中具有绝对位置的缩略图上
【发布时间】:2011-11-07 21:55:49
【问题描述】:

我创建了一个缩略图网格,当将鼠标悬停在上面时,图片会消失,并显示块颜色并显示图像的标题。但是在 Internet Explorer 中,图片和文字不会出现在他们设置的缩略图空间中,它们都在左下角出现。

图片和标题存储在box/category-widescreen div中,这是wordpress的动态代码。

有什么想法吗?

#page-wrap {width: 1060px; padding-bottom: 40px;}
.box { margin: 20px; float: left; }

.category-widescreen { width: 400px; height: 229px; background: #FF0000; }
.category-widescreen a{text-decoration: none;}
.category-widescreen h1{font-size: 30px; color: #FFF; line-height: 34px;}
.category-widescreen h2{font-size: 26px; color: #FFF;  line-height: 30px;}

.title{position:absolute; top:14px; left:14px; z-index: 0; padding-right: 14px;}

.category-widescreen img { max-width: 400px; max-height: 229px; float: right; padding: 0 0 2px 10px; z-index:1; position:relative;}

感谢您的帮助!

【问题讨论】:

标签: css internet-explorer thumbnails css-position


【解决方案1】:

太模糊了!正如其他人建议的那样,给出基本的 html 结构。但是,一些观察:
使用的字体大小是不是有点太大(30px 和 26px)?;
标题{位置:绝对; ...} .... 确保父级的样式是 position:relative 否则会变得一团糟;
浮起来怎么样?您是否确保事情朝着正确的方向发展?

希望对您有所帮助,或者至少让您大开眼界!哈哈哈……

【讨论】:

  • 谢谢你的位置:亲戚在我的盒子 elelement 上工作.. 有些图片仍然超出边距,但我现在会调查一下!
【解决方案2】:

您需要将position:relative 设置为您的帖子,以便绝对定位的元素知道该关注的位置。

试试这个:

.post {
position:relative;
}

【讨论】:

    猜你喜欢
    • 2017-09-18
    • 1970-01-01
    • 2012-01-07
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多