CSS Summary 17:html block-level elements & inline elements: <div> and <span>

Source: Internet
Author: User

1 HTML chunk elements: most HTML elements are defined as block-level elements or inline elements .

1.1 Block-level element example: <div>

Characteristics of block-level elements: Exclusive line, can be set to wide height

1.2 row-level element instance :<span> <a>

Row-level element features: One row can be arranged multiple, not set wide height.

1.3 Inline block elements : most:<input> used

Row-level element features: A row can be arranged more than one, you can also set the width of high.

2 common label row inner block characteristics of the difference introduced:

The common use of 2.1 html<div> elements is document layout. It replaces the old-fashioned way of using tables to define layouts. Is the region that defines the document, block-level (Block-level)

Using the <table> element for document layout is not the correct use of the table. The function of the <table> element is to display tabular data.

2.2 HTML <span> elements are inline elements that can be used as a container for text

The <span> element also has no specific meaning. is used to group inline elements within a document, inline elements (inline)

When used with CSS, the,<span> element can be used to set style properties for some text.

CSS Summary 17:html block-level elements & inline elements: <div> and <span>

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.