HTML syntax is made of four main and most common components:
- Element
- Attributes
- an attribute is a property assigned to an element
- many attributes are common amongst elements while some can be assigned only a particular element
- examples of a common attribute is id="", class="" or title="" while a specific attribute would be cellpadding="" or maxlength=""
- Element's body or text
- element's text can be assigned only to non-empty elements and it must be integrated between opening and closing tags
- example is <p>This is my first website</p>
- Comments
- regular comments are added to the HTML syntax in order to better understand the internal process or in order to bypass certain parts of code
- conditional comments can be used to conduct a special message to a proprietary software, i.e. it can be used with Internet Explorer to check which version is running
- comments are not displayed in a browser
Example
HTML example with comments inside the code:
Comments
No comments have been made yet.
Please login to leave a comment. Login now