如何获取按钮左下角的文字?

时间:2014-02-07 09:34:01

标签: javascript html css

我正在尝试将按钮中的文本与按钮的左下角对齐,但是没有任何填充量似乎正常工作!有人请帮我这样做。这就是我所拥有的。

Fiddle

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>

1 个答案:

答案 0 :(得分:4)

Updated DEMO

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>