Html5 div and span html block-level elements, html5span
HTML <div> and <span>
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. |