HTML elements are divided into 2 types: Block Element and Inline Element. Refer to the following article by Mytour for detailed information on HTML block elements.
HTML Block Elements
1. HTML Block Elements
1.1. Block Elements in HTML
1.2. Inline Elements in HTML
1.3. HTML
1.4. HTML Element
2. Conclusion
1. HTML Block Elements
1.1 Block Elements in HTML
A block element usually starts on a new line and occupies the entire available width.
The div element is a block element.
Example: The following example illustrates block elements in HTML:
The output after applying the block element appears as follows:
Below is the list of block elements in HTML:
1.2 Inline Elements in HTML
Inline elements in HTML do not start on a new line and only occupy sufficient width.
Example: Refer to the example below to learn about inline elements in HTML:
The result returned after applying the inline element appears as follows:
Below is the table listing the inline elements in HTML:
1.3 HTML div Element
The div element in HTML is commonly used to contain other HTML elements.
The div element does not require attributes; however, style, class, and id are common attributes.
When used with CSS, the div element can be used to specify block-level formatting for content.
Example: Refer to the illustrative example below to understand the div element in HTML:
The result returned after applying the div element appears as follows:
1.4 HTML span Element
The result returned after applying the span element appears as follows:
2. Conclusion
Below is a table listing the tags in HTML:
In the above article, Mytour just introduced you to HTML block elements. Additionally, if you have any questions or need further clarification, readers can leave their comments below the article for answers and better HTML learning. In the upcoming articles, Mytour will continue to introduce you to the class attribute in HTML.