0%

HTML div and span

HTML can combine elements with <div> and <span>.

HTML block element

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

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

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

HTML inline elements

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

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


HTML <div> element

The HTML <div> element is a block-level element that can be used to combine containers of other HTML elements.

The <div> element has no specific meaning. In addition, because it is a block-level element, the browser displays the folds before and after it.

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

Another common use of the <div> element is the document layout. It replaces the old-fashioned way of defining a layout using a table. Document layout using the <table> element is not the correct usage of the form. The <table> element is used to display tabular data.

HTML <span> element

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

The <span> element also has no specific meaning.

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