HTML element is an individual components of HTML documents. Most of HTML elements with start tag, end tag and content in between.
HTML element is an individual components of HTML documents. Most of HTML elements with start tag, end tag and content in between. Elements can contain attributes:
<p class = "myfirstclass"> This is my paragraph </p>| | | | |Start Attribute Value Content EndTag Tag
👉Elements - Empty Elements
- Empty elements are not container tags
- Typical example of empty element is - <br>
- Some other example of empty elements are - <img>, <input>, <link>, <meta>, <hr> etc.
👉Elements - Writing Comments
- Making the source code easier to understand
- May help other developer or you to understand what you are trying to do with html
- Comments are hidden in browsers
Begins with <!..... and Ends with .....>
<!-- This is HTML Comment -->
<!-- This is a multi-line HTML Comment
which have more than one line -->
👉Elements Types:
1. Block Level:- Block Level occupies 100% of available width
Rendered with line break before and after.
Example:- <div>, <p>, <h1> through <h6>, <form>, <ol>, <ul>, <li>, <dl>, <pre>, <blockquote>, etc.
2. Inline Level:- As much as width needed.
Example:- <img>, <a>, <spam>, <strong>, <b>, <em>, <i>, <code>, <input>, <button>, etc.
NOTES:
Most HTML tags look something like the following:
<thetagname>affected text</thetagname>
The tag name itself (here, thetagname) is enclosed in angle brackets(< >). HTML tags generally have a beginning and an ending tag surrounding the text they effect. The beginning tags "turns on" feature (such as headings, bold, and so on), and the ending tag turns it off. Closing tag contain the tag name preceded by a slash (/). The opening tag (for example, <p> for paragraphs) and closing tag (for example, </p> for paragraphs) compose what is officially called an HTML element.