HTML block and inline

Source: Internet
Author: User

HTML elements can be grouped together with <div> and <span>

HTML block elements

Most HTML elements are definedBlock levelElements orInlineElements.

Block level elements normally start (and end) with a new line when displayed in a browser.

Examples: <H1 >,< P >,< ul >,< table>

HTML inline Elements

Inline elements are normally displayed without starting a new line.

Examples: <B >,< TD >,< A >,< img>

The HTML <div> element

The HTML <div> element is a block level element that can be used as a container for grouping other HTML elements.

The <div> element has no special meaning. Handle t that, because it is a block level element, the browser will display a line break before and after it.

When used together with CSS, the <div> element can be used to set style attributes to large blocks of content.

Another common use of the <div> element, is for document layout. it replaces the "Old Way" of defining layout using tables. using tables is not the correct use of the <Table> element. the purpose
The <Table> element is to display tabular data.

The HTML <span> element

The HTML <span> element is an inline element that can be used as a container for text.

The <span> element has no special meaning.

When used together with CSS, the <span> element can be used to set style attributes to parts of the text.

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.