Html5 div and span html block-level elements, html5span

Source: Internet
Author: User

Html5 div and span html block-level elements, html5span

HTML <div> and <span>

  • HTML list
  • HTML class

You can combine HTML elements through <div> and <span>.

HTML block elements

Most HTML elements are defined as block-level elements or Inline elements.

Editor's note: "block-level elements" are translated into block-level elements and "inline elements" are translated into inline elements.

When a block-level element is displayed in a browser, it usually starts (and ends) with a new line ).

Example:

HTML inline Element

Inline elements are usually not displayed starting with a new line.

Example: <B>, <td>, <a>,

HTML <div> element

An HTML <div> element is a block-level element. It is a container that can be used to combine other HTML elements.

<Div> the element has no specific meaning. In addition, because it is a block-level element, the browser will display a line before and after it.

If used with CSS, the <div> element can be used to set style attributes for Large content blocks.

<Div> another common purpose of an element is document layout. It replaces the old-fashioned method of defining la s using tables. Using the <table> element for document layout is not the correct usage of the table. <Table> an element is used to display tabular data.

HTML <span> Elements

HTML <span> elements are inline elements and can be used as text containers.

The <span> element has no specific meaning.

When used together with CSS, the <span> element can be used to set style attributes for some texts.

HTML grouping tags

Tag

Description

<Div>

Define the partition or section (division/section) in the document ).

<Span>

Defines span to combine the line elements in the document.

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.