Lab #3: INTRODUCTION TO HTML TAG
INFORMATION
HTML tags are used to mark-up HTML elements:
HTML tags are surrounded by the two characters < and >
The surrounding characters are called angle brackets
HTML tags normally come in pairs like <b> and </b>
The first tag in a pair is the start tag, the second tag is the end tag
The text between the start and end tags is the element content
HTML tags are not case sensitive, <b> means the same as <B>
CODE GIVEN:
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<p>Welcome to my first web page. <br>I am writing this page using a text editor and plain old html.</p>
<h1 align="center">My First Webpage</h1>
<p>Welcome to my first web page. <br>I am writing this page using a text editor and plain old html.</p>
<p>By learning html, I'll be able to create web pages like a pro... <br>
which I am of course.</p>
</body>
</html>
OUTPUT OF THE CODE:
EXPLANATION:
The code starts with <html> and ends with </html>.
The tag <head> contains the information of the code such as the title of the webpage, the code for the appearance of the webpage which is the CSS, the font you want to use in the webpage, and so on. This information is not visible to the users. It ends with </head>.
<title> tag is for the name of the webpage which in this case is My first Webpage. It ends with </title>.
The <body> part represents the visible part of the code. <h1> means header 1 which is “My First Webpage” which is aligned to the centre of the page by using code align=“center”.
The <p> here means paragraph. <br> in the between text is for new line. The paragraph ends with </p>.
The body ends with </body> and the code ends with </html>
There two types of HTML tags:
1. Associated tags.
Paired tags have an opening and closing tag. The opening tag is similar to the single <h1> tag, and the closing has the first slash </h1>, between them write content (text, images or other) and for this they are called containers.
2. Singular tags.
A tag is defined to be a singular tag when there is no closing tag for it or a tag is considered a singular tag when there is no companion tag.
Some examples of HTML tags on both types of HTML tags.
1. Associated tags.
<b> …</b> = for bold the text
<h1> …. </h1> = for header
<div> … </div> = for division or section
2. Singular tags.
<br> = for new line
<hr> = for horizontal rule
<!--> = for comment










