我想将我的 Button 对齐到页面的中心。可以使用哪个属性。
我在下面附上了我的 .html 和 .js 文件代码图像。
您可以像这样使用 Css dispaly flex 使您的按钮居中:
#content{ display:flex; justify-content:center; align-items:center; height:100vh; }
<body id="content"> <button>button</button> </body>