我试图在 HTML 中对齐屏幕中间的两个按钮。当我尝试使用text-align: center;它时,它不起作用。下面是我的按钮代码。
<style>
.button {
margin-top: 15px;
background-color: #0066FF;
border: none;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
}
<body>
<div class="floated run">
<form action="aboutus.html">
<button class="button">See Projects</button>
</form>
</div>
<div class="floated run">
<form action="end.html">
<button class="button">About Us</button>
</form>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
我知道这个问题有多种答案,但到目前为止,没有一个对我有帮助。