【发布时间】:2015-09-04 21:46:20
【问题描述】:
考虑下面的代码:
<!doctype html>
<html>
<body>
<div style="background-color: yellow; width: 100vw; height: 100vh; text-align: center;">
<button style="display: block; margin-left: auto; margin-right: auto;">This is a button</button>
</div>
</body>
</html>
我尝试在 Chrome 和 Mozilla 中运行它,它会产生以下输出:
但是,当我尝试在 android 浏览器中运行它时,按钮位于左侧,似乎 margin-left 和 margin-right 在 android 浏览器上不起作用。知道为什么吗?
【问题讨论】:
标签: html android-browser