HTML Basics
An HTML document consist of its basic building blocks which are:
- All HTML documents must start with a document type declaration:
<!DOCTYPE html>
. - The HTML document itself begins with
<html>
and ends with</html>
. - The visible part of the HTML document is between
<body>
and</body>
.
Tags :
- HTML tags are markers used to define the structure and formatting of content within a webpage.
- There are various tags like <h1>, <p> and <img> which define various content elements.
Attributes :
- HTML provide additional information about an element and are used to modify its behavior or appearance. An HTML attribute contains two fields: name & value.
- There are various tags like href, src and style which define various content elements.
First, you have to learn appropriate syntax.
Syntax:
Here are two examples that show the correct syntax of tags and attributes.
<tag_name> content </tag_name>
<tag_name attribute_name= " attr_value"> content </ tag_name>