Lab 3- Introduction to HTML Tag

 

 

Name

 

 

LOY DONG XUAN

 

 

Matric. No.

 

AI2000236

 

 

Section

 

 

6

 

LabSheet3

Introduction to HTML TAG

 

 

The following are the code that saves as mypage.html

<html>

<head>

<title>My First Webpage</title>

</head>

<body>

<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 page like a pro... <br>which I am of course.</p>

</body>

</html>

 

 


 

Figure 1.1 shows the HTML code displayed on the browser.


1. Explain about the HTML code above.

<html>
<head>
<h1align ="center"> My First webpage</h1>                  //This is a center align heading text
</head>
<body>
<p>
    Welcome to my first web page.                              //This is a paragraph.
    <br> I am writing this page using a text editor and plain old html     //<br> used to break the line
</p>
<p>
By learning html, I'll be able to create web page like a pro... //This is another paragraph.
<br> which I am of course.
</p>
</body>
</html>

Figure1.2 shows the structure of HTML code.

We have everything surrounded in the HTML tag, we have the start and ending tag. Inside that, we have a head area and a body area. The head has nothing to do with the output that is in the browser.

 

The head has things like the page title has things like links to CSS files and JavaScript files that we want to use metadata such as the description and keywords things like that the description and keywords are actually used by search engines like Google so that it knows some more information about what actually on the web page. In this case, the page title is “My First Webpage.”.

Then in the body, we have the actual markup that is going to display in the browser so headings text images things like that. We make the "My First Webpage" centered by adding 'align = "center" ' behind “h1”. We make a new paragraph, the text displayed is “Welcome to my first web page” and followed by the text “I am writing this page using a text editor and plain old html”. We noticed that <br> breaks the text so both texts are not in the same line. We can also use < div > < / div > to make a new line instead of <br>.

 

And then we created a new paragraph, the text displayed is “By learning html, I’ll be able to create web page like a pro...” and followed by the text “which I am of course”. We noticed that <br> breaks the text once again so both texts are not in the same line.



2. Explain about the two types of HTML Tags?

 

In paired tag, the first tag is called the opening tag and the second tag is called the closing tag. The closing tag has a / slash, which means that the tag is closed now. The second type of tag is the singular tag, which is also known as a stand-alone tag or empty tag.

 

Here is an example to differentiate paired tags and unpaired tags:-

Paired Tags

 

Unpaired Tags

 

<i>This text is in italics. </i>

 

<br> , <hr>

 



3. Give some examples of HTML tags on both types of HTML tags.

List of some paired tags in HTML:

Open tag

 

Close tag

<html>

</html>

<table>

</table>

<form>

</form>

<span>

</span>

<ul>

</ul>

<p>

</p>

<head>

</head>

<div>

</div>

 

Some unpaired tags are:

Open tag

 

<br>

 

<hr>

 

<meta>

 

<input>

 















Comments

Popular posts from this blog

Genshin HTML

LabSheet8_The div dl, dd, and dt elements