css - 左右边距在 Firefox 和 Chrome 中对齐不同

标签 css

我只开发了我的观看 firefox。完成后我在 chrome 中打开我的网站..然后我看到对齐问题...

代码如下

<span class="fbtopbutton"> <div id="left"> <a href="#"><img src="/images/fb-login.png"></a> </div></span>

我在 html 代码的不正确位置使用此代码..(因为某些 php 代码限制..)这就是为什么使用 margin-left top 和 right

CSS 代码 .fbtopbutton{ position: absolute;margin-top: 5px;margin-left: 27px;}

在火狐浏览器中 firefox view 在 Chrome View 中 enter image description here

最佳答案

尝试:

.fbtopbutton{ position: absolute;top: 5px;right:(however far from the right you need it to be)}

确保父级也绝对定位或相对定位。

关于css - 左右边距在 Firefox 和 Chrome 中对齐不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13074517/

相关文章:

css - Angular-material: md-select 移动容器元素

css - 实现背景过滤器 : opacity(0%) in CSS

html - 如何让我的表格图像大小相同?

javascript - 如何使用以第一个为条件的 Bootstrap 制作辅助导航栏?

html - 使用线性渐变 &::before::after 在 css 中创建的背景图像不会随着网页展开

html - 无法识别 CSS 目标计数器属性

html - JSON 文件 - 打印多个信息

jquery - 单击时保持链接颜色直到单击另一个链接

css - 输入字段中的对齐图标

css - 另一个 div 高度不适应内容发布