Javascript Chrome忽略动态更改元素的相对定位 我想在DIV的中间显示一个加载图像,当我点击它时。但在Chrome中,图像显示在左上角。只有动态内容才会发生这种情况。图像在Firefox中的位置正确

Javascript Chrome忽略动态更改元素的相对定位 我想在DIV的中间显示一个加载图像,当我点击它时。但在Chrome中,图像显示在左上角。只有动态内容才会发生这种情况。图像在Firefox中的位置正确,javascript,jquery,html,css,google-chrome,Javascript,Jquery,Html,Css,Google Chrome,如果位置是绝对的 使用顶部、左侧、右侧和底部 当位置是相对的 使用上边距、左边距、右边距和下边距 .inner_text { position: relative; margin-top:25%; } .loading_img { position: relative; margin-top:20%; } 两种浏览器都可以正常工作 .inner_text { position: relative; margin-top:25%; } .loading_img { position: rela

如果位置是绝对的

使用顶部、左侧、右侧和底部

当位置是相对的

使用上边距、左边距、右边距和下边距

.inner_text { position: relative; margin-top:25%; }
.loading_img { position: relative; margin-top:20%;  }
两种浏览器都可以正常工作

.inner_text { position: relative; margin-top:25%; }
.loading_img { position: relative; margin-top:20%;  }