English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML block is a box that stores tags, grouping tags.
HTML can group elements using <div> and <span>.
<div> <strong>Home</strong>Appreciate</em>Feedback</em></div><!-- Content --><div> em>HTML Basic Tutorial<3codebox.com</em>CSS Tutorial</em>JavaScript Tutorial</em></div>Test to see ‹/›
Most HTML elements are defined as block-level elements or inline elements.
Block-level elements usually start on a new line when displayed in the browser (and end).
Examples: <h1, <p>, <ul>, <table>
Inline elements usually do not start on a new line when displayed.
Examples: <b>, <td>, <a>, <img> <i>
The HTML <div> element is a block-level element, which can be used as a container for other HTML elements.
The <div> element does not have a specific meaning. In addition, since it is a block-level element, the browser will break the line 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 document layout. It replaces the outdated method of using tables to define layout. Using the <table> element for document layout is not the correct use of the table element. The <table> element is used to display tabular data.
The HTML <span> element is an inline element, which can be used as a container for text.
The <span> element does not have a specific meaning.
When used with CSS, the <span> element can be used to set style properties for part of the text.
Tags | Description |
<div> | Defined the areas of the document, block (block)-level) |
<span> | Used to combine inline elements within a document, inline elements (inline) |