HTML Basics Practicals
HTML Basics Practicals
HTML Basics Practicals
Print a paragraph that is a description of a book, include the title of the book as well as its author.
Names and titles should be underlined, adjectives should be italicized and bolded.
Print your name to the screen with every letter being a different heading size.
Print the squares of the numbers 1 - 20. Each number should be on a separate line, next to it the
number 2 superscripted, an equal sign and the result. (Example: 10 2 = 100)
Prints 10 names with a line break between each name. The list should be alphabetized, and to do
this place a subscripted number next to each name based on where it will go in the alphabetized list.
(Example: Alan1). Print first, the unalphabetized list with a subscript number next to each name, then the
Print two paragraphs that are both indented using the command.
Print two lists with any information you want. One list should be an ordered list, the other list should
be an unordered list.
Prints an h1 level heading followed by a horizontal line whose width is 100%. Below the horizontal
Print ten acronyms and abbreviations of your choosing, each separated by two lines. Specify the
Create some links to various search engines (google, yahoo, altavista, lycos, etc).
Create links to five different pages on five different websites that should all open in a new window.
Display five different images. Skip two lines between each image. Each image should have a title.
Display an image that has a border of size 2, a width of 200, and a height of 200.
Display an image that when clicked will link to a search engine of your choice (should be opened in
a new window).
Display an image that when clicked will link to itself and will display the image in the browser by
itself.
HTML basics exercises
Create a webpage that prints your name to the screen. [See solution]
<html>
<body>
John
</body>
</html>
Create a webpage that prints the numbers 1 - 10 to the screen. [See solution]
<html>
<body>
1 2 3 4 5 6 7 8 9 10
</body>
</html>
Create a webpage and set its title to "This is a webpage". [See solution]
<html>
<head>
<title>This is a webpage</title>
</head>
<body>
<p class="note">
</p>
</body>
</html>
HTML text exercises
Print your name in green. [See solution]
<html>
<body>
<font color="green">John</font>
</body>
</html>
Print the numbers 1 - 10, each number being a different color. [See solution
<html>
<body>
<font color="green">1</font>
<font color="blue">2</font>
<font color="gray">3</font>
<font color="yellow">4</font>
<font color="pink">5</font>
<font color="brown">6</font>
<font color="violet">8</font>
<font color="purple">9</font>
<font color="indigo">10</font>
</body>
</html>
<html>
<body>
<font face="Tahoma">John</font>
</body>
</html>
Print a paragraph with 4 - 5 sentences. Each sentence should be a different font. [See solution]
<html>
<body>
<p>
</font>
</font>
<font face="Helvetica">
</font>
<font face="Georgia">
HTML is used to specify the way webpages look, not how they
function.
</font>
</p>
</body>
</html>
Print a paragraph that is a description of a book, include the title of the book as well as its author.
Names and titles should be underlined, adjectives should be italicized and bolded.[See solution]
<html>
<body>
<p>
One particular book which is recommended reading is <u>The Street Lawyer</u> by <u>John
Grisham</u>. This book is about a lawyer who begins re-evaluating his priorities in life when a bad
incident occurs within his law firm. Consequently, he becomes acquainted with the inner city streets, and
realizes the harsh existence of the homeless, and vows to give them a chance in the courts. <u>The Street
Lawyer</u> is a <b><i>great</i></b>
</p>
</body>
</html>
Print your name to the screen with every letter being a different heading size.[See solution]
<html>
<body>
<h4>J</h4>
<h3>o</h3>
<h2>h</h2>
<h1>n</h1>
</body>
</html>
HTML text formatting exercises
Print the squares of the numbers 1 - 20. Each number should be on a separate line, next to it the
number 2 superscripted, an equal sign and the result. (Example: 10 2 = 100) [See solution]
<body> 6<sup>2</sup> = 36
16<sup>2</sup> = 256
Prints 10 names with a line break between each name. The list should be alphabetized, and to do
this place a subscripted number next to each name based on where it will go in the alphabetized list.
(Example: Alan1). Print first, the unalphabetized list with a subscript number next to each name, then the
alphabetized list. Both lists should have an <h1> level heading.[See solution]
<body> Wendy<sub>9</sub>
Jane<sub>4</sub>
Jane Thomas
Roger Wendy
Sandra William
Stacy </html>
<br />
Print two paragraphs that are both indented using the command.[See solution]
<html> <p>
<body>
Comput programs are designed and implemented.
what to <p>
programs. </body>
by which these
Print two lists with any information you want. One list should be an ordered list, the other list
<html> </ol>
<li>Modem</li> </ul>
</body> </html>
Prints an h1 level heading followed by a horizontal line whose width is 100%. Below the horizontal
line print a paragraph relating to the text in the heading. [See solution]
<html>
<body>
<h1>Cookie</h1>
<p> A delicious confection that is quite popular when it comes to sweets. Cookies come in various varieties
including chocolate chip, raisin, and macademia nut. A very different type of cookie is a small text file stored
</p>
</body>
</html>
Print some deleted and inserted text of your choosing. [See solution]
<html>
<body>
</body>
</html>
<html> <dt>Technology</dt>
<dl> a means to
<dt>Lettuce</dt> </dl>
Print ten acronyms and abbreviations of your choosing, each separated by two lines. Specify the
<p>
<body> </a>
Create links to five different pages on five different websites that should all open in a new window.
<html> </a>
Display an image that has a border of size 2, a width of 200, and a height of 200.
<html>
<body>
</body>
</html>
Display an image that when clicked will link to a search engine of your choice (should be opened in a new window).
<html>
<body>
</a>
</body>
<p>
</p>
</html>
Display an image that when clicked will link to itself and will display the image in the browser by itself.
<html>
<body>
</a>
</body>
<p>
</p>
</html>
<html> <img src ="1.jpg" width="10%"
height="25%"align="right" >
<head>
<h1 style="color:red">Saleem Ahmed</h1>
<title> Resume </title>
<p> House #5, XYZ Area Karachi </p>
</head>
<p> Contact#123456789</p>
<body bgcolor="yellow">
<h3 > <mark style="background-
color:green">Introduction </h3>
<p> I am an experienced web designer with an However, skills can be given in numbered - list
excellent track record. I have worked with as well.
famous organization in the last 8 years. You can
<font color= blue>
check my work ...