有填充和保證金之間的差異
填充適用於該元件的內部(添加一種「內部邊界」,像一幀,即從邊界推動含量遠) 例如:施加到輸入,一個10px的填充將移動從文本邊框,並將其放置10px的內部
餘量適用於元素的大體位置。
指BOX models
請記住,它適用 - >頂/右/下/左
填充10px的25px的0 50px的會做10之上,25日吧,底部爲0,左側爲50。
在你的情況,適用於一些填充表中,如果你想擁有的標題是「說明」,並輸入一個名爲「說明」之間更多的空間:
這裏有一個例子,用它玩和適應根據你的需要:)
<style>
.description {
width: 75%;
height: 38px;
padding: 10px;
}
.margin {
margin: 50px auto; // applies to TOP/BOTTOM (left/right is auto)
}
.padding {
padding: 25px; // applies to Top/Right/Bottom/Left
}
</style>
<div class="margin">
<table>
<tr>
<td class="padding">Description</td>
<td class="padding"><input type="text" name="Description" class="description"></td>
</tr>
</table>
</div>
爲什麼'padding-left:1000px;'?刪除它,然後檢查 – Bhaskar
'padding-left:1000px;'??? – OldPadawan
請修改標籤,因爲它更多的CSS,而不是PHP ...編輯:感謝您添加正確的標籤 – OldPadawan