You are on page 1of 4

Learning HTML

Lab 1

Objective :
1- To know what is HTML?
2- To learn basic HTML tags.
3- To create simple HTML page.

What is HTML ?
HTML stands for Hyper Text Markup Language ,used to create web pages :

1- It’s a formatting language (not programming).


2- Interpreted by browser.
3- Not case sensitive.
4- Each command called tag.

Example 1:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>

Text Formatting :
Example 2:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

Eng: Samah Al-atifi E-Commerce “B4IT”


<h1>My First Heading</h1>
<p>This

Is

My first web page.</p>


</body>
</html>

Example 3:

<!DOCTYPE html>
<html>
<body>
<b>The text is bold!</b>

<strong>The text is strong!</strong >

<hr/>
<i>The text is italic!</i>

<!--This comment will not be displayed.-->

this is<sub> subscript</sub> and this is <sup> superscript </sup>


</body>
</html>

Example 4:

<!DOCTYPE html>
<html>
<body>
<pre> for(int i=0;i<5;i++)

print i;

</pre>
<p> for(int i=0;i<5;i++)

print i; <p>
</body>
</html>

Eng: Samah Al-atifi E-Commerce “B4IT”


Example 5:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>to break <br>lines<br>in a<br>paragraph<br>use the br tag.<p>
</body>
</html>

HTML Attributes
Example 6:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body bgcolor=”red”>
<h1 align=”center”>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>

Example 7:

<!DOCTYPE html>
<html>
<body>
<a href=”index.html”>Link to index page!</a>
<a href=”index.html” target=”_blank”>open index page in new window!</a>
</body>
</html>

Example 8:

<!DOCTYPE html>
<html>
<body>
<img src=”a.jpg” align=”right”>
</body>
</html>

Eng: Samah Al-atifi E-Commerce “B4IT”


Eng: Samah Al-atifi E-Commerce “B4IT”

You might also like