Chapter 7 Class 10th Excercise
Question 4: Create a web page in HTML that displays image of a printer. The width of image should be 250 pixels and height 150 pixels.
Ans:
Adding Image in a Web Page
The image tag (<img>) with its src attribute is used for displaying an image in a web page. Image is not part of HTML file, it is a separate file stored in computer’s memory.
HTML Web Page For Displaying an Image
<html>
<head><title> Image </title></head>
<body>
<img src=”printer.png” width=250 height=150> <br>
</body>
</html>
Question 6: Create an HTML document that contains a graphical hyperlink.
Ans:
Creating Hyperlink Using HTML
You can create hyperlink to anchor using the normal <a></a> tag with href attribute. The syntax for this is
<a href=”link”>text to that you want to appear</a>
HTML Code for Graphical Hyperlink
<html>
<head><title> Image </title></head>
<body>
<a href=”https://tropytech.com/wp-content/uploads/2022/01/How-to-Check-Zong-Number-Without-Balance-%E2%80%93-Latest-SIM-Code-Methods-2022.gif” ></a> <br>
</body>
</html>
HTML Code for Simple Hyperlink
<html>
<head><title> Image </title></head>
<body>
<a href=”https://tropytech.com/flat-social-data-zong/” ></a> <br>
</body>
</html>
Question 7: Create a web page in HTML that contains unordered and ordered list.
Ans:
Unordered List
In an ordered list each item of the list generally starts with a bullet. Unordered is a list in which items have no numbers. Tha tag that unordered list uses is <ul></ul>. The item tag is <li></li>.
Ordered List
All the items in ordered list start with a number and the numbers are in ascending order. The tag that is used in ordered list is <ol></ol>. The item tag is <li></li>.
HTML Code for Ordered and Unordered List
<html>
<head>
<title>Ordered and Unordered List</title>
</head>
<body>
<h3> Types of Secondary Memories </h3>
<ol>
<li>Hard Disk</li>
<li> CD and DVD</li>
<li> USBFlash Drive</li>
<li> Memory Cards</li>
</ol>
<h3> Types of Computers </h3>
<ul>
<li> Microcomputer</li>
<li> Minicomputer</li>
<li> Mainframe Computer</li>
<li> Super Computer</li>
</ul>
</body>
</html>
Question 8: Create an HTML document that contains hyperlink to three websites.
Ans:
<html>
<head>
<title> Link to 3 Websites</title>
</head>
<body>
<a href=”https://tropytech.com/”>Tropy Tech</a><br>
<a href=”https://www.ilmkidunya.com/”>Ilm Ki Dunya</a><br>
<a href=”https://www.biseatd.edu.pk/”>BISE Abbottabad</a><br>
</body>
</html>