HTML inline elements and block elements

Source: Internet
Author: User

I. HTML inline elements and block elements


1. Block elements are generally more overbearing, rejecting them in the same line as other elements. Like a div, and width and height work on it.

2. Inline elements can only hold text or other inline elements, and it allows to be in the same row as other inline elements. such as span. However, width and height do not work for it.

3. Of course, block elements and inline elements can be swapped with each other. Set Display:inline for block elements, or set display:block for inline elements;

4. All block elements:

address– address blockquote– block Reference center– Center-align dir– directory list div– common block-level easy, is also the main label of CSS layout

dl– definition List Fieldset–form control group form– Interactive form Good h1-h6-title hr– horizontal divider Isindex–input Prompt

menu– Menu list Noframes–frames Optional content (for browsers that do not support frame, display this chunk content noscript– optional script content (for browsers that do not support script, display this content

ol– ordered form P – paragraph pre– formatted text table– table ul– unordered list

5. Common block elements:

DIV-block P-paragraph h1 ~ h6-Big title table, form-table, form • UL, OL-non-sorted list, sort form hr-Horizontal split Line

6. Common inline elements:

A-anchor span-inline block BR-line Wrap input-input Box img-Picture Select-Project Location textarea-Multiline text input box

7. All inline elements:

A – Anchor point abbr– abbreviation acronym– first word b – bold (not recommended) Bdo–bidi override

big– Large font br– cite– reference code– computer code (required when referencing source)

dfn– defining fields em– emphasizing font– font settings (not recommended) I – Italic img– pictures

input– input Box kbd– define keyboard text label– table label Q – Short reference S-underline (not recommended)

samp– Definition Example computer code select– item selection small– Small font text span– Common inline container, defining text within chunks

strike– underlined strong– bold emphasis on sub– subscript sup– superscript

textarea– Multi-line text tt– telex text u underline var– define Variables


HTML inline elements and block elements

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.