Before starting with our tutorials of HTML we should first understand HTML basic components.
These are HTML basic components:-
Tags in Html are a basic element of Html documents. Tags are a kind of sign board which tells the browser how to present the contents nested inside. Every tag performs different tasks in an HTML document.
A tag starts with a less-than angle bracket (
<) and ends with greater-than angle bracket (
>) with tag name in-between.
Every tag must be enclosed in < >.
Generally every tag is closed by </tag>.
<tag> content </tag>
Example: <p> tag is used for paragraph. <h1> tag is used for headings.
Elements is an individual component of a web page which is used to define the structure of a webpage.
This is the syntax of the element for paragraph.
This is the syntax of element for heading.
In HTML when we use tags like <p>,<pre> or <h1> then we use it simply without specifying how the text should be displayed.
To add extra information to the tag we use attributes.
Attributes have two parts: name and the value. value part should be written in quote;either in single quote '' or in double quote "".
To write attribute for some tag we write it as follows:
<tag name="value"> content </tag>
Attribute for img tag:
src attribute used to provide URL of image.
alt attribute is used as alternative text when image is not available.
Attribute for anchor tag:
href specifies a link to any address.
Inline style attribute:
style attribute adds additional information as how our text or web page to be presented.