Basic Programs
Basic Programs
<html>
<head>
<title>TEXT-FORMATTING-TAGS</title>
</head>
<body>
<p> This is
a paragraph. </p>
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and line breaks
</pre>
</body>
</html>
3
2. Write a HTML program by using text formatting tags.
<html>
<head>
<title>TEXT-FORMATTING-TAGS</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
<p> This is
a paragraph. </p>
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and line breaks
</pre>
</body>
</html>
4
3. Write a HTML program using presentational element tags tags
<b>, <i>, <strike>, <sup>, <sub>, <big>, <small>, <hr>
<html>
<head>
<title>Presentational-Elements</title>
</head>
<body>
Defines text: <b>bold </b> typeface <br>
Defines text: <i>italic </i> typeface <br>
Defines text : <u>underlined </u> typeface<br>
It strikes the text <strike>strikethrough </strike>
<br>
Formula for Water : H<sub>2</sub>O <br>
E = mc<sup>2</sup>. It's the world's most famous equation
<br>
The following word should be <big>bigger</big> than
those around it.<br>
The following word should be <small>smaller</small> than
those around it.<hr>
</body>
</html>
5
5. Write a HTML program using different list types.
<!DOCTYPE html>
<html>
<head>
<title>Types of Lists</title>
</head>
<body>
<h3> Here is an unordered list, which is just a bulleted
list:</h3>
<ul>
<li>Bullet point number one</li>
<li>Bullet point number two</li>
<li>Bullet point number three</li>
</ul>
8
6. Create a HTML page that displays ingredients and instructions to
prepare a recipe.
<html>
<head>
<title>recipe</title>
</head>
<body bgcolor= cyan>
<h2>Banana Milkshake</h2>
<b>Ingredients:</b>
<ul>
<li>1 banana</li>
<li>250ml Milk</li>
<li>3 Ice cubes</li>
</ul>
<b>Method:</b>
<ol>
<li>Peel the banana and add to the blender</li>
<li>Add the milk and ice cubes to the blender</li>
<li>Turn on the blender for 30 seconds</li>
</ol>
<hr>
</body>
</html>
10