HTML elements are the building blocks of every webpage. They define the structure and content of a web page.
<p>This is a paragraph</p>
Start Tag → <p>
Content → This is a paragraph
End Tag → </p>
The opening part of an element.
Example:
<h1>
The information placed between opening and closing tags.
The closing part of the element.
Example:
</h1>
| Element | Purpose |
|---|---|
| <h1> - <h6> | Headings |
| <p> | Paragraph |
| <a> | Hyperlink |
| <img> | Insert image |
| <ul> | Unordered list |
| <ol> | Ordered list |
| <li> | List item |
| <div> | Container block |
| <span> | Inline container |
HTML elements can be placed inside other elements. This is called Nesting.
<p>
Visit <a href="https://google.com">Google</a>
</p>
Some HTML elements do not contain any content. These are called Empty Elements.
| Element | Purpose |
|---|---|
| <br> | Line break |
| <hr> | Horizontal line |
| <img> | Display image |
<B>
and
<b>
work the same way.
Which tag is used to create a hyperlink?