【发布时间】:2014-02-19 02:46:10
【问题描述】:
我的图像在 chrome 和 firefox 中的显示方式不同。
这是一个小提琴http://jsfiddle.net/SEOplay/4FGad/2/ 在 Firefox 和 chrome 中打开它,你会看到图像尺寸不同。
Chrome 会根据需要显示图像。
HTML
<div id="imageContent">
<div id="bigImgCon">
<a href="<?php echo $firstImg; ?>" rel="lightbox"><img id="firstImage" rel="lightbox" src="http://placekitten.com/200/400" /></a>
</div>
</div>
CSS
div#imageContent {
width:100%;
text-align:center;
margin:0 auto;
}
div#bigImgCon {
width:100%;
max-height:300px;
overflow:hidden;
position:relative;
margin-top:10px;
background-color:red;
}
img#firstImage {
max-width:100%;
max-height:100%;
cursor:hand;
cursor:pointer;
display:inline-block;
}
【问题讨论】:
-
如果有一些差异的截图会很棒。
-
@Matt 一个好的、独立的 SO 问题将包括屏幕截图。
-
@admdrew 有道理,但我在许多与 CSS 相关的帖子中看到了指向 jsfiddle 的链接(没有屏幕截图)
-
@Vallentin 帮助或不帮助,但对我来说,当“专家”抱怨有人努力提供很多细节的问题时,这很烦人。也许只有我一个人不会打扰这里的其他人。
-
@Matt 我同意,我不介意有人建议我提供屏幕截图,并且 admdrew 对自包含问题提出了观点。只是进来而不对实际问题做出任何贡献有点烦人。特别是如果页面上已经有足够的信息可以做到这一点。