Block element Center, Element classification (block, inline, inline block), inline to block

Source: Internet
Author: User

Text in a block element, picture centered:

CSS settings: text-align:center
<styletype= "Text/css">Div{text-align:Center;}</style></Head><Body><Div><imgsrc= "Http://img.mukewang.com/52b4113500018cf102000200.jpg" ></Div>

Element classification:

block element , inline element (also called inline Element) , and inline block element .

The most common block elements are:

<div>, <p>,

The commonly used inline elements are:

<a>, <span>, <br>, <i>, <em>, <strong>, <label>, <q>, <var>, < Cite>, <code>

used in Inline block Elements are:

, <input>

Inline elements and block elements are converted to each other:

Display:block//Convert inline elements to block elements, such as <a>

Display:inline//Convert block elements to inline elements, such as <div>, <p>

Display:inline-block//Convert element to inline block element.

Inline element Features:

1, and other elements are on one line;

2, the height of the element, the width and the top and bottom margin is not set;

3. The width of the element is the width of the text or Picture it contains, and it cannot be changed.

Inline-block Inline block element features:

1, and other elements are on one line;

2, the height of the element, width, row height, and the top and bottom margin can be set.

Block element Center, Element classification (block, inline, inline block), inline to block

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.