【问题标题】:Auto Size Buttons To Cover 1/3 of Screen Each自动调整大小按钮,每个按钮覆盖 1/3 的屏幕
【发布时间】:2015-02-05 13:10:24
【问题描述】:

我想让以下三个按钮拉伸以覆盖我的网页的 100%,这样每个按钮大约占页面的 1/3,它们之间有一个小的间隙。

提前致谢:)

<a style="padding: 6px 35px; background-color: #838383; color: #fff; text-transform: uppercase; letter-spacing: -.2px; text-decoration: none; font-family: helvetica,arial,sans-serif; border-radius: 2px; font-size: 12px;" href="http://www.my-url.com">BUTTON 1</a>
&nbsp;
<a style="padding: 6px 35px; background-color: #636363; color: #fff; text-transform: uppercase; letter-spacing: -.2px; text-decoration: none; font-family: helvetica,arial,sans-serif; border-radius: 2px; font-size: 12px;" href="http://www.my-url.com">BUTTON 2</a>
&nbsp;
<a style="padding: 6px 35px; background-color: #434343; color: #fff; text-transform: uppercase; letter-spacing: -.2px; text-decoration: none; font-family: helvetica,arial,sans-serif; border-radius: 2px; font-size: 12px;" href="http://www.my-url.com">BUTTON 3</a>

【问题讨论】:

    标签: html css button hyperlink size


    【解决方案1】:

    或者没有 calc(更简单的版本)。这是更新的小提琴http://jsfiddle.net/fk2naw3q/4/

    a {
      float: left;
      width: 32.667%;
    }
    a + a{
      margin-left: 1%;
    }
    

    【讨论】:

    • 谢谢老兄,这太棒了 - 现在只需要弄清楚如何在按钮之间放置间隙。
    猜你喜欢
    • 1970-01-01
    • 2017-12-02
    • 2018-03-03
    • 2015-10-29
    • 2019-11-20
    • 2019-05-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多