gpt4 book ai didi

Firefox 中的 HTML 元素位置不同

转载 作者:行者123 更新时间:2023-11-28 17:00:00 26 4
gpt4 key购买 nike

这是我的 design .底部的右箭头在 chrome 和 IE 中看起来不错。但在 Firefox 中它的位置不同。

 #prev{
background-image: url("http://oi57.tinypic.com/2ztfrx4.jpg");
background-repeat: no-repeat;;
}

#next{
background-image: url("http://oi60.tinypic.com/2wpjazt.jpg");
background-repeat: no-repeat;;
}

Please check the attached image .

我附上了在 Firefox 中运行的图像,右箭头位置向下。

我该如何解决这个问题?

最佳答案

您可以在 #next 上使用负边距来解决对齐问题,如下所示。

由于您为图标图像/元素指定了宽度,只需将左边距设置为宽度的负值,在本例中为 -26px。

此解决方案适用于最新版本的 Firefox、Chrome 和 IE。

#prev {
background-image: url("http://oi57.tinypic.com/2ztfrx4.jpg");
background-repeat: no-repeat;
display:inline-block;
width:26px;
height:26px;
}
#next {
background-image: url("http://oi60.tinypic.com/2wpjazt.jpg");
background-repeat: no-repeat;
display:inline-block;
width:26px;
height:26px;
float: right;
margin-left: -26px;
}
.products {
border-style: solid;
border-width: 1px;
border-color: #98bf21;
text-align:center;
white-space:normal;
}
<div id="container">
<div id="catalog" style="width:300px;height:557px;">
<div id="logo">
<img alt="Mountain View" src="http://files.usmre.com/4215/mountain%20view%20lake.jpg" style="width:300px;height:200px;">
</div>
<div class="products" id="productTitle" style="width:296px;height:350px; font-size: 24px;"></div>
</div>
<div style="position:relative;display:block;padding:0px;margin:0px;white-space:nowrap;width:300px;padding-top:10px">
<div id="prev"></div>
<div id="next"></div>
</div>
</div>

关于Firefox 中的 HTML 元素位置不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31444300/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com