Element in the CSS row and block-level element

Source: Internet
Author: User

Although some elements can use CSS (display: block/inline) to convert intra-row elements and block-level elements, some cannot. For example, labels such as H1, H2, and H3 embedded in DT do not comply with W3C standards.

Although the problem has been solved, I am not very familiar with the line elements (also called inline elements) and block-level elements. The following content is collected from the Internet.

In the standard document stream, that is, if there is no other CSS style control, the block-level element occupies one line, that is, the bandwidth is always the same as the browser width and has nothing to do with the content. The width of the element in the row is only related to the content.

Inline elements are generally basic elements based on the semantic level (semantic. Inline elements can only contain text or other inline elements. Common inline elements are "".

Both block element and inline element are concepts in the HTML specification. The basic difference between block elements and inline elements is that block elements generally start from a new line. After CSS control is added, the attribute differences between block elements and inline elements will not be different. For example, we can add the inline element cite to the display: block attribute so that it also has attributes starting from the new line each time.

Block element ):

* Address-address

* BLOCKQUOTE-block reference

* Center-align Blocks

* Dir-directory list

* Div-common block-level labels are easy, and they are also the main labels of CSS layout.

* Dl-definition list

* Fieldset-Form Control Group

* Form-interactive form

* H1-large title

* H2-subtitle

* H3-Level 3 title

* H4-4 level title

* H5-Level 5 Title

* H6-6 titles

* HR-horizontal Separator

* Isindex-input prompt

* Menu-Menu list

* Optional content of noframes-frames. (content in this block is displayed in browsers that do not support frame.

* NoScript-) Optional script content (this content is displayed in browsers that do not support scripts)

* Ol-sorting form

* P-paragraph

* Pre-format text

* Table-table

* Ul-non-sorted list


Inline element ):


* A-anchor

* Abbr-abbreviation

* Acronym-First word

* B-bold (not recommended)

* BDO-bidi override

* Big-large font

* Br-line feed

* CITE-Reference

* Code-computer code (required when source code is referenced)

* Dfn-define a field

* Em-emphasis

* Font-font setting (not recommended)

* I-italic

* IMG-Image

* Input-input box

* KBD-defines the keyboard text

* Label-Table label

* Q-short reference

* S-hyphen (not recommended)

* Samp-Defines sample computer code

* Select-select a project

* Small-small font text

* Span-commonly used inline containers that define text blocks

* Strike-dashes

* Strong-highlighted in bold

* Sub-subscript

* Sup-superscript

* Textarea-multi-line text input box

* Tt-telex text

* U-underline

* Var-define variables

Original article: http://vway.info/vway/css.htm

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.