css教程:CSS填充padding属性的应用

The CSS padding properties define the space between the element border and the element content.

CSS填充属性定元素边框到内部内容间的距离

设置左填充 Set the left padding

This example demonstrates how to set the left padding of a tablecell.

Examples 实例:

Source Code to Run [www.fun52.com]

td {padding-left: 2cm}

This is a tablecell with a left padding. www.fun52.com . This is a tablecell with a left padding.

   [ 可先修改部分代码 再运行查看效果 ]

设置右填充 Set the right padding

This example demonstrates how to set the right padding of a tablecell.

Examples 实例:

Source Code to Run [www.fun52.com]

td {padding-right: 5cm}

This is a tablecell with a right padding. www.fun52.com . This is a tablecell with a right padding.

   [ 可先修改部分代码 再运行查看效果 ]

设置上填充 Set the top padding

This example demonstrates how to set the top padding of a tablecell.

Examples 实例:

Source Code to Run [www.fun52.com]

td {padding-top: 2cm}

This is a tablecell with a top padding

www.fun52.com

   [ 可先修改部分代码 再运行查看效果 ]

设置底部填充 Set the bottom padding

This example demonstrates how to set the bottom padding of a tablecell.

Examples 实例:

Source Code to Run [www.fun52.com]

td {padding-bottom: 2cm}

This is a tablecell with a bottom padding

www.fun52.com

   [ 可先修改部分代码 再运行查看效果 ]

快速设置所有填充属性 All the padding properties in one declaration

This example demonstrates a shorthand property for setting all of the padding properties in one declaration, can have from one to four values.

第 1 2 页

css教程:CSS填充padding属性的应用

相关文章:

你感兴趣的文章:

标签云: