Css tutorial: CSS Padding tutorial

Source: Internet
Author: User

The CSS of this attribute defines the boundaries and element content between the filled space elements.

Let's look at several examples.

The code is as follows: Copy code

<Html>
<Head>
<Style type = "text/css">
Td. test1 {padding: 1.5}
Td. test2 {padding: 0.5 2.5}
</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.5 and a left and right padding of 2.5.
</Td>
</Tr>
</Table>
</Body>

Set the value of padding-top cm
This example shows how to set the value of filling a table cell with centimeters at the top.

The code is as follows: Copy code

<Html>
<Head>
<Style type = "text/css">
Td {padding-top: 2 cm}
</Style>
</Head>

<Body>
<Table border = "1">
<Tr>
<Td>
This is a tablecell with a top padding
</Td>
</Tr>
</Table>
</Body>

</Html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.