Monday, 18 July 2016

Class 7 - HTML worksheet 1

1. Write a program in HTML to display the following :

My first program                        ---------------------------- 1
I am in class 7                               -----------------------------2

Bishop Cotton Boys' School        -----------------------------3

<html>
<head>
<title> Example 1</title>
</head>
<body >

<b> My first program</b> <br>
 I am in  <I> class 7 </I> <p>
<u> Bishop Cotton Boys' School</p>
</body>
</html>


The  line1 is darker than the rest of the program. This is because of the bold tag. to go to the next line use the <br> tag.
In line 2 , only class 7 is slanting , so use italics tag for that.
There is a blank line between  line 2 and line 3, so paragraph tag should be used. Even if you close <p> before <u> tag also will give same effect.
In line 3,a line is drawn below the whole sentence using <u> tag.

2. What would be the output for the following program:
<html>
<head>
<title> Example 2</title>
</head>
<body bgcolor=olive text=yellow>           ------------------1
 Computers<br>Class 7                             ------------------ 2
<p>                                                            ------------------ 3
Cottonnian shield 

</p>
</body>
</html>


Line 1 : the background colour. The spelling is bgcolor. The foreground color is yellow. Remember it is text,  not text color.
Line 2 : <br> tag moves the cursor to the next line.So Class 7 is displayed in the next line.
Line 3 : <p> tag leaves a blank line.




No comments:

Post a Comment