Introduction: In HTML, elements are broadly divided into two categories: block-level and inline. Block elements take up the full width, while inline elements only take as much space as needed.
[Block Elements] [Inline Elements] [Comparison]It is used as a generic container to group other HTML elements together
It is used to write a paragraph
It is used to give the main heading of our HTML page
It is used to give the sub-heading of our HTML page
It is used to write the text in a HTML page
It is used to create an unordered list
It is used to create an ordered list
It is used for making a form
It is used to make a section in HTML
It is used to make an article in HTML
The text inside this element becomes bold
The text inside this element becomes italic
The text inside this element becomes underlined
The text inside this element becomes important & bold
The text inside this element becomes emphasized
It is used to wite a superscript
It is used to write a subscript
It is used to highlight text
It is used to give abbreviation
It is used to write code
#include (iostream)
#include (iostream.h);
int main()
{
int a=5;
int b=7;
int sum=a+b;
return 0;
}
| Block Elements | Inline Elements |
|---|---|
| <div> | <b> |
| <p> | <i> |
| <h1> | <u> |
| <h2> | <strong> |
| <h6> | <em> |
| <ul> | <sup> |
| <ol> | <sub> |
| <form> | <mark> |
| <section> | <abbr> |
| <article> | <code> |