gpt4 book ai didi

css - Firefox 和 Chrome 之间有 1 个像素的差异

转载 作者:太空宇宙 更新时间:2023-11-03 18:38:25 26 4
gpt4 key购买 nike

我写了一个简单的html。

<div class="button">button<div>

这一行的CSS是

.button {
background-color: #F1631F;
position: absolute;
bottom: 10px;
left: 20px;
}

但是 firefox 和 chrome 之间有一个像素的差异。

chrome firefox

左边是 chrome,右边是 firefox。我的按钮是橙色的。

请问有什么好的解决办法吗?

顺便说一句,我已经添加了

* {  margin: 0; padding: 0; border: 0;}

在我的 css 文件的开头。

父 html 和 css:

<div class="item">
<div class="button"></div>
</div>

.item{
margin-top: 25px;
text-align: right;
}

最佳答案

设置.button的高度并添加

overflow:visible;

给 parent 。

您可能需要花一些时间来找到最适合您的界面的高度。

关于css - Firefox 和 Chrome 之间有 1 个像素的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18179633/

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