龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > div+css/html >

css教程:CSS Padding 教程

时间:2012-12-29 08:41来源:未知 作者:admin 点击:
分享到:
css教程:CSS Padding 教程 该属性的CSS定义填充的空间要素之间的边界和元素含量。 来看几个例子吧. html head style type=text/css td.test1 {padding: 1.5cm} td.test2 {padding: 0.5cm 2.5cm} /style /head body table

css教程:CSS Padding 教程

该属性的CSS定义填充的空间要素之间的边界和元素含量。

来看几个例子吧.

<html>
<head>
<style type="text/css">
td.test1 {padding: 1.5cm}
td.test2 {padding: 0.5cm 2.5cm}
</style>
</head>

<body>
<table border="1">
<tr>
<td class="test1">
This is a tablecell with equal padding on each side.
</td>
</tr>
</table>
<br />
<table border="1">
<tr>
<td class="test2">
This tablecell has a top and bottom padding of 0.5cm and a left and right padding of 2.5cm.
</td>
</tr>
</table>
</body>

设置padding-top 厘米的价值
这个例子表明如何设置顶端填充一个表格单元格使用厘米的价值。

<html>
<head>
<style type="text/css">
td {padding-top: 2cm}
</style>
</head>

<body>
<table border="1">
<tr>
<td>
This is a tablecell with a top padding
</td>
</tr>
</table>
</body>

</html>


精彩图集

赞助商链接