我正在尝试将按钮中的文本与按钮的左下角对齐,但是没有任何填充量似乎正常工作!有人请帮我这样做。这就是我所拥有的。
CSS
.button {
width: 187px;
height: 187px;
border: none;
margin-bottom: 11px;
margin-right: 11px;
display:inline-block;
font-size: 16px;
color: white;
}
.text {
position: absolute;
padding-top: 65px;
padding-right: 35px;
font-size: 16px;
color: white;
}
HTML
<div id="column">
<div class="row">
<button class="button"> <span class="text"></span>
</button>
<button class="button"> <span class="text"></span>
</button>
</div>
</div>
答案 0 :(得分:4)
将position: relative
添加到.button
.button {
position:relative;
width: 187px;
height: 187px;
border: none;
margin-bottom: 11px;
margin-right: 11px;
display:inline-block;
font-size: 16px;
color: white;
}
.text {
position: absolute;
bottom: 0px;
left: 0px;
font-size: 16px;
color: white;
}
<div class="row">
<button class="button">
<span class="text">Button</span>
</button>
<button class="button">
<span class="text">Button</span>
</button>
</div>