css - CSS 中的相对定位

标签 css

.loading-icon {
  pointer-events: none;
  margin: auto;
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  position: relative;
  margin: 50px 0;
  line-height: 25px;

在 firefox 和 chrome 中,对象在页面中居中,而在 IE10 中,对象不居中并且向左显示

最佳答案

您有 2 个边距属性。 Chrome 和 Firefox 以一种方式处理它,而 IE 以另一种方式处理它。

删除重复项并将第一个更改为:

margin: 50px auto;

同样如评论中所述,将display: inline-block;改为

display: block; 或直接删除它。

关于css - CSS 中的相对定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23898914/

相关文章:

html - 试图使 div 框展开

html - 使用 CSS 添加渐变背景

css - Ruby on Rails - Bootstrap/Form_for vs input_groups - 如何停止样式冲突

html - 如何使用 CSS 正确选择第一个或最后一个 child ?

javascript - 我的谷歌地图被切断了,我想知道为什么? Javascript,V

html - 如何在css中将一个长字符串换行并截断为三行

html - 将元素从嵌套的 "CSS Grid"移到外部

html - 从最大的表中删除行颜色

不使用 url 的 CSS 背景

javascript - 主动应用于一个元素