HTML Block


HTML can group elements together with <div> and <span>


HTML block element

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

Block-level elements usually start (and end) on a new line when displayed by the browser.

Examples: <h1>, <p>, <ul>, <table>


HTML inline elements

Inline elements usually do not start on a new line when displayed.

Examples: <b>, <td>, <a>, <img>


HTML <div> element

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

The <div> element has no specific meaning. In addition, since it is a block-level element, browsers display line breaks before and after it.

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

Another common use of the <div> element is document layout. It replaces the old-fashioned way of defining layouts with tables. Using the <table> element for document layout is not the proper use of tables. The purpose of the <table> element is to display tabular data.


HTML <span> element

HTML <span> elements are inline elements that can be used as containers for text

The <span> element also has no specific meaning.

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


HTML grouping tags

LabelDescribe
<div>Defines the area of ​​the document, block level (block-level)
<span>Used to combine inline elements in a document, inline elements(inline)