小编Kg1*_*123的帖子

如何在html中将中间的两个按钮与一定的边距对齐

我试图在 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)

我知道这个问题有多种答案,但到目前为止,没有一个对我有帮助。

html css center button

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

button ×1

center ×1

css ×1

html ×1