Professional Documents
Culture Documents
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 :
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>
Is
Example 3:
<!DOCTYPE html>
<html>
<body>
<b>The text is bold!</b>
<hr/>
<i>The text is italic!</i>
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>
<!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>