HTML Elements
An HTML doument is described by HTML element. There ar four basic elements of HTML. They are html, head, title and body.
there are a lot of element in html. They start with opening tag and end with closing tag. Between the opening and closing tag there remain content of the element.
Everything from the opening tag to closing tag are called HTML element.
Example:
Features of HTML Element
- Start with opening tag.
- End with closing tag.
- There are element content between the opening and closing tag.
- All the elements are not required the closing tag. They are called void element.
Example of void elements:
In the example <br> is a void element. It has no ending tag.
Categories of HTML Elements
Depending on the default view and style, HTML elements ar divided into two parts.
- Inline element
- Block level-element
Inline Element: Inline element does not cause for a line break or does not start with a new line. It also does not take the whole wide of a webpage. Generally it is used between other HTML elments.
Example: <i>, <img>, <a>, <em>, <b>, <input> etc.
Block-level Element: Block-level element always start with a new line. It also takes the whole wide of a webpage. Other HTML elements can be used between the Block-level element.
Example: <div>, <article>, <p>, <h1> to <h6>, <ul>, <li>, <ol> etc.