In the previous article, Taimienphi.vn introduced you to lists (lists) in HTML. The next article below Taimienphi.vn will introduce you more about the block element in HTML.
HTML elements are classified into 2 categories: Block Element (block element) and Inline Element (inline element). Refer to the following article of Taimienphi.vn to find out the block element in HTML.
Block elements in HTML
Table of Contents:
1. Block element in HTML
1.1. Block Element in HTML
1.2. Inline Element in HTML
1.3. Element (div) in HTML
1.4 The element (Span) in HTML
1. Block element in HTML
1.1 Block Element in HTML
A block element usually starts on the new line and takes up the entire available width.
Element div is a block element.
For example: The following example illustrates the block element in HTML:
The result returned after applying the block element has the following form:
Here is a list of block elements in HTML:
1.2 Inline Element in HTML
Inline Element in HTML does not start with a new line and only occupies a sufficient width.
For example: Refer to the following example to learn about inline elements in HTML:
The result returned after applying the inline element has the following form:
The following is a list of inline elements in HTML:
1.3 The div element in HTML
Element div HTML is often used to contain other HTML elements.
Element div Does not require attributes, however style, class and id are common attributes.
When used with CSS, elements div can be used to specify the type of block for the content.
For example: Refer to the example illustrated below to easily visualize the element div in HTML:
Results returned after the element is applied div Look like this:
1.4 The span element is in HTML
Molecules span in HTML is often used as an element containing text (text).
Element span Does not require attributes, however style, class and id are common attributes.
When used with CSS, elements span can be used to specify styles for portions of text.
For example: The following is an example to illustrate the element span in HTML:
Results returned after the element is applied span Look like this:
Below is a list of the tags in the HTML:
The above article Taimienphi.vn has just introduced you to the block element (block) in HTML. In addition, if you have any questions or questions, you can leave your comments in the comment section below the article to get a better description and learn HTML. In the next articles, Taimienphi.vn will introduce you further class attributes in HTML Please.