如何将我的按钮对齐到页面的中心?

问题描述 投票:0回答:1

我想将我的 Button 对齐到页面的中心。可以使用哪个属性。

我在下面附上了我的 .html 和 .js 文件代码图像。 .html file .js

javascript html sapui5
1个回答
0
投票

您可以像这样使用 Css dispaly flex 使您的按钮居中:

#content{
  display:flex;
  justify-content:center;
  align-items:center;
  height:100vh;
  }
<body id="content">
  <button>button</button>
</body>

© www.soinside.com 2019 - 2024. All rights reserved.