0% found this document useful (0 votes)
3 views

Basic Programs

The document contains multiple HTML programs demonstrating various text formatting tags, including basic tags like <p>, <br>, and <pre>, as well as presentational elements such as <b>, <i>, and <strike>. It also showcases different list types (unordered, ordered, and definition lists) and provides a recipe format with ingredients and instructions. Each section is structured with appropriate headings and formatting to illustrate the use of HTML elements.

Uploaded by

tufitufail247
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Basic Programs

The document contains multiple HTML programs demonstrating various text formatting tags, including basic tags like <p>, <br>, and <pre>, as well as presentational elements such as <b>, <i>, and <strike>. It also showcases different list types (unordered, ordered, and definition lists) and provides a recipe format with ingredients and instructions. Each section is structured with appropriate headings and formatting to illustrate the use of HTML elements.

Uploaded by

tufitufail247
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Write a HTML program using basic text formatting tags, <p>,


<br>, <pre>.

<html>
<head>
<title>TEXT-FORMATTING-TAGS</title>
</head>
<body>

<p> This is
a paragraph. </p>

This text contains<br>a line break.

<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>

This text contains<br>a line break.

<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>

<h3>Here is an ordered list using numbers:</h3>


<ol>
<li>Point number one</li>
<li>Point number two</li>
<li>Point number three</li>
</ol>

<h3>Here is a definition list:</h3>


<dl>
<dt>Unordered List</dt>
<dd>A list of bullet points.</dd>
<dt>Ordered List</dt>
<dd> An ordered list of points, such as a
numbered set of steps.</dd>
<dt>Definition List</dt>
<dd>A list of terms and definitions.</dd>
</dl>
</body>
</html>

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

You might also like