CSS element classification

Source: Internet
Author: User

Quick-level elements: <div>,<p>,Setting Display:block is the display of elements as block-level elements.
Converts inline element A to block-level elements so that a element has block-level element characteristics
A{display:block;}

inline elements: ,<span>,<a>,<label>,<input>,,<strong>,<em> in HTML is a typical inline element.
Display:inline

Inline block elements : with inline elements, block element features, code: Display:inline-block
,<input> tag is this inline block tag

Box Model:
Border: Is the line around the content and filler, which can set its thickness, style and color (border three properties)
div{
border:2px solid red;
}
Attention:
Border-style (border Style) common form:
Dashed (dashed line) dotted (dot) solid (solid)
Border-color (border color) color can be set to hexadecimal color
If you want to set the bottom border separately for the P label, and the other three sides do not set the border style:
div{border-bottom:1px solid Red;}

Width and Height: CSS defines the width and breadth of the content that is filled in.
An element's actual width = left boundary + right boundary + left padding + content width + right padding + right border + right boundary

The actual length of the element is: 10px+1px+20px+200px+20px+1px+10px=262px

Fill: the element content and the border can be set distance, called "fill"; fill can also be divided into upper, right, bottom, left (clockwise)
div{padding:20px 10px 15px 30px;}
Four directions for Padding-top Padding-right Padding-bottom padding-left

Boundary:The distance between elements and other elements can be set using boundaries (margin), which can also be divided into upper, right, bottom, and left
div{margin:20px 10px 25px 30px;}
Four directions: margin-top margin-right Margin-bottom Margin-left

CSS element classification

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.