【问题标题】:How do you separate buttons in HTML如何在 HTML 中分隔按钮
【发布时间】:2016-02-05 04:57:53
【问题描述】:

我创建了一个页面,上面有 3 个按钮,但所有按钮都并排卡住,我不知道如何在它们之间添加空间。 这是目前为止的页面。

<div style="width: 500px; margin-left: 20px;">
  <a href="https://drive.google.com/file/d/0B9B-lYnsBAPHcFlkT3NQQThpa1E/view?    usp=sharing" target="_blank">
    <input type="submit" name="" value="View Study" />
  </a>
  <a href="https://drive.google.com/file/d/0B9B-lYnsBAPHT2c2MHhJN0l5NlE/view?    usp=sharing" target="_blank">
    <input type="submit" name="" value="View Study" />
  </a>
  <a href="https://drive.google.com/file/d/0B9B-    lYnsBAPHZ0xoTUlnZGZMaWc/view?usp=sharing" target="_blank">
    <input type="submit" name="" value="View Study" />
  </a>
</div>

【问题讨论】:

标签: html


【解决方案1】:

您可以为所有按钮添加样式,周围有一些边距,如下所示

input[type='button']
{
    margin:10px 10px 10px 10px; //just an example, you can add according to your need
}

【讨论】:

    【解决方案2】:

    尝试将一个类添加到您的 div 并将其样式化到您的 ss 中,而不是将其硬编码到您的 html 中。稍后您将能够通过此类修改所有链接。但是,如果您必须在 html 中设置样式,只需将其添加到所有 &lt;a&gt; 标签中:style="margin-right: 10px;"

    例子:

    <a href="yourlink.html" style="margin-right: 10px;" target="_blank"><input type="submit" name="" value="View Study"/></a>
    

    【讨论】:

      【解决方案3】:

      您也可以
      并打破线,然后在您的顶部,您可以将其居中或向左或向右并使其成为不同的区域。

      【讨论】:

      • 请在您的回答中提供更多详细信息。正如目前所写的那样,很难理解您的解决方案。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-12
      • 1970-01-01
      相关资源
      最近更新 更多