展会信息港展会大全

css教程:CSS Padding 教程
来源:互联网   发布日期:2016-03-25 16:00:45   浏览:2062次  

导读:该属性的CSS定义填充的空间要素之间的边界和元素含量。来看几个例子吧.代码如下复制代码 <html><head><style type=...

该属性的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>

赞助本站

人工智能实验室

相关热词: 开发 编程 android

AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港