我有3个按钮,我希望它具有相同的高度。我也希望它在选项卡分辨率中也具有相同的高度。我希望这可以在CSS中实现。

谁能告诉我我如何实现这一目标。

HTML:

<div class="content">
    <p>It's easy to become a member. </p>
    <p> Join today online    </p>
    <div class="btn-wrap">
        <div class="row">
            <div class="col"><a href="">Find Nearest Agent</a></div>
            <div class="col"><a href="" >Join Now</a></div>
            <div class="col"><a href="" >Download the App</a> </div>
        </div>
    </div>
</div>


CSS:

.content {
    width:75%; //there is a reason to use 75% here coz I have to place an image for remaining 25%.
}

.btn-wrap {
    display:table;
    border-collapse: separate;
    width:100%;
    overflow: hidden;
}

.row {
    display:table-row;
}

.col {
    display:table-cell;
    padding: 0 0.5% 0;
    width:32%;
    float: left;
}

a {
    font-size: 20px;
}

input[type="submit"], a {
    border: 0 none;
    box-sizing: border-box;
    display: block;
    font-family: "Lato",Arial,sans-serif;
    font-size: 17px;
    font-style: normal;
    font-weight: 900;
    margin: 0;
    padding: 20px 10px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    background-color: #ff0;
    color: #1d6221
}


JSFiddle:http://jsfiddle.net/qwdduc7z/5/

最佳答案

height: 75px;添加到input[type="submit"], a{。例如。 here

10-08 16:37