Introduction to HTML Tags
An html tag is a signal to a browser that is should do something other than just through text up on the screen.
By convention all HTML tags begin with an open angle brackets (<) and the end with the close angle brackets (>)
- Html tags are used to mark up HTML elements
- Html tags are surrounded by the two character <and>
- The surroundings characters is called angle brackets
- Html tags normally come in pair like <b> and </b>
- The first tag in the pair is the start tags, the second tag is the end tag.
- The text between the start and end tag is the element content.
- Html tags are not case sensitive, <b> mean the same as <B>
Types of HTML tags
There are two types of html tage
- Paired Tags
- Singular tags
Paired tags
Pair tag is it along with a companion tags. E.g the <b> is the paired tag. The <b> tag with it companion tag </b>cause the text contained between them to be in bold. In pair tags the first tag <b> is the called starting tag or opening tag. And </b> is known as closing tag or ending tag.
Singular tags
The second type of tag is the singular or stand alone tags.
A stand along does not have companion tag or closing tag.
E.g<br> tag will insert a line break. But this tag does not require any companion tag.
Introduction to Tag Attributes.
- Tag can have attribute Attribute can provide additionalinformation about the HTML element on your page.
- This tag defines the body body element of your HTML page: <body> with an add bg color attribute. You can tell the browser that the background color of your page should be red like this
- <body bgcolor=“red”>
Attributes always come in name/value pair like this : name =“value”
Attribute are always added to the start tag of an HTML element.
Quite style, “red” or ‘red’
Attribute value’s should always be enclosed in quotes. Double style quotes are the most common but single style quotes are also allowed.
In some rare situtaions, like when the attribute value it self contains quotes. It is necessary to use single quotes.
Name=‘john”shotgun”Nelson’