我想知道如何水平對齊我的按鈕?最重要的是,我想添加文本到這些按鈕。這是我目前擁有的。將CSS/HTML中的按鈕與文本水平對齊在一行中對齊?
HTML正文部分:
<body>
<div class="tile_div">
<table class="tile_table">
<tr>
<td>
<img class="tile_image" height="50px" width="100px" src="./images/button_left.png"/>
<p class="tile_p">Button one</p>
</td>
<td>
<img class="tile_image" height="50px" width="100px" src="./images/button_left.png"/>
<p class="tile_p">Button two</p>
</td>
<td>
<img class="tile_image" height="50px" width="100px" src="./images/button_left.png"/>
<p class="tile_p">Button three</p>
</td>
</tr>
</table>
</div>
</body>
CSS:
.tile_image {
float: left;
margin: 0px;
}
.tile_image img {
position:absolute;
}
.tile_p {
text-align:center;
position:relative;
}
如何,它看起來像: http://img580.imageshack.us/img580/8867/uo7i.png
我希望文本在按鈕的中間不低於他們。
編輯:
好了,所以當我用 src="./images/button_left.png"
圖像看起來他們的方式看起來應該:
http://img580.imageshack.us/img580/8867/uo7i.png
但是當過我使用的背景圖像 出現這種情況: http://img580.imageshack.us/img580/6127/yz4.png
「按鈕」 不應該點擊? – bitWorking
他們應該是可點擊的,我是新的HTML&CSS。 – Alex
看看我的答案http://stackoverflow.com/questions/17629788/aligning-buttons-in-css-html-in-one-line-horizontally-w-text/17629849#17629849 – 2013-07-13 11:49:01