PHP Full Stack Development (eight): Cssⅷborder margin padding

Source: Internet
Author: User

In CSS, all HTML elements can be viewed as a box.

So in the design and layout, the most commonly used, that is, to define the margin of the box is margin

Defining the inner margin of the box is padding.

The width of the element's content is set by the wide property, so what is the total width of the element in the HTML page?

is width + padding-left + padding-right + border-left-width + border-right-width This is the total width of the entire HTML page that the element occupies.

For borders, we can use Border-style to set the style of the border

Use Border-width to set the width of the border.

Use Border-color to set the color of the border.

Set the margin of an element by using the margin property.

You can set up and down on the left and right, using the following syntax:

Margin-top top margin; Margin-bottom: Bottom margin margin-left: Left margin; Margin-right: Right margin.

The use of padding is similar to how margin is used.

PHP Full Stack Development (eight): Cssⅷborder margin padding

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.