CSS base inline element block level element

Source: Internet
Author: User

1. Inline elements (inline element inlineelement)

Features: Do not occupy a row, can not set the width and height of the row height, its breadth as the content increases, height with the font size and change, margin only to the left and right, the upper and lower invalid.

Common are:

A-anchor point, B-Bold (not recommended), BR-newline, em-accent, font-typeface (not recommended), I-Italic, img-picture, input-input box, label-table label,

Select-Project selection, small-small font text, span-common inline container, define text within chunks, strike-underline, strong-bold accent

2, block-level elements

Features: Beginning to occupy a row from the new line, you can set the width of high, row high, internal and external margins, the width of the default browser width, height with the font size and change, margin only to the left and right, the upper and lower invalid.

Common are:

Div-most commonly used block-level elements, DL-and DT DD with block-level elements, form-interactive form, H1-big title, hr-Horizontal divider, ol-Sort form, p-paragraph, ul-non-sorted

Tips:1, display can convert inline elements and block-level elements to each other under certain circumstances

2. Text-align:center can center inline elements in block-level elements, but cannot be centered with margin:0 auto when the inline element is set to block-level elements, in which case the Padding property can be used to extend the width of the inline element without changing its inline property. can be centered.

3, the current use of the center mode, the horizontal center text-align:center can make the picture or text in the block level elements of the horizontal center, line-height can be set to the same height as the block-level elements, to achieve horizontal center; block-level elements are centered using margin:0 Auto.

CSS base inline element block level element

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.