HTML PROGRAMS CLASS VIII

 

HTML stands for Hypertext Markup Language.  Markup language is a technique to write

documents, describing the general structure of the contents inside the

documents and not its actual appearance on the page or on the screen.

HTML allows user to link several related information already stored in the

computer or server that can be accessed from anywhere around the world.

Tim Berners Lee developed the HTML standard in 1989, and the

world wide web in 1991.

Tools Required to create a webpage

1. Text Editor- A text editor is used to create or compose HTML

documents. Examples- Notepad and wordpad.

2. A Web Browser- A Web browser is used to display and view the HTML

documents.

Examples- Internet explorer, Mozilla Firefox, opera and safari.


TAG- A tag is an HTML command that controls the structure and appearance

of the page or document that is created. Every tag has attributes or special

properties.

The tags are always enclosed within a pair of angular brackets i.e. < and >.

CONTAINER ELEMENTS- This type of HTML elements require pair tags i.e. a

starting as well as an ending tag e.g., <TITLE>……</TITLE>,

<HEAD>…..</HEAD>.

EMPTY ELEMENTS- This type of HTML elements requires just a starting tag

and not an ending tag e.g. <BR>, <BASE>. Empty elements just carry out

their specific job e.g., <HR> inserts a horizontal rule and <BR> breaks a line.

PROG 01

<html>

<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><b>Tip:</b> Use h1 to h6 elements only for headings. Do not use them just to make text bold or big. Use other tags for that.</p>

</body>

</html>


Prog 2

<html>

<body>

<h2>An unordered HTML list</h2>

<ul>

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>  

</body>

</html>

prog 3

<html>

<body>

<h2>An ordered HTML list</h2>

<ol>

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ol>  

</body>

</html>

prog 4:-

<html>

<body>

<h2>HTML Image</h2>

<img src="sunflower.jpg" alt="rose" width="100" height="200">

</body>

</html>



AUDIO AND VIDEO

Audio Example:

<audio controls>
  <source src="audiofile.mp3" type="audio/mpeg">
</audio>

Video Example:

<video width="300" height="200" controls>
  <source src="movie.mp4" type="video/mp4">
</video>


Inserting Images and Lists in HTML

Q1. Tick the correct option:-

i. Which of the following is an attribute of <img> tag?

ANS C. Alt

ii. Which tag specifies the placement of the image around the surrounded text?

ANS C. Align

iii. .................... attribute is used to play the music continuously?

ANS C. Loop

iv. Which of the following is not an attribute of <ol> element?

ANS A. Align

v. Which item marker allows to create a list starting from 6?

ANS  A. <ol start="6">

Q2 Fill in the Blanks

1. .................... attribute of <img> specifies the alternate text.

Answer: Alt

2. .................... list generates the items in a sequence.

Answer: Ordered (or Ordered List / <ol>)

3. .................... is another name for bulleted list.

Answer: Unordered list (or <ul>)

4. A list inside another list is called ....................

Answer: Nested list

5. .................... tag is used to insert audio to the webpage.

Answer: <audio>

 

 

 

 

 

Q3. State True or False

i. URL attribute of the <img> tag is used to insert images.

Answer: False

ii. You cannot have an ordered list inside an unordered list.

Answer: False

iii. Border-radius creates a border around the image.

Answer: False

iv. Numbered list is another name for bulleted list.

Answer: False

v. You cannot control the dimensions of the image in CSS.

Answer: False

 

Answers to the HTML Exercise

1. Define list.

·         Answer: In HTML, a list is a structured way to group and display a collection of related items or pieces of information clearly and orderly on a webpage.

2. What are the uses of the <img> tag?

Answer:

a.      It is used to embed images (such as photos, graphics, or illustrations) into an HTML webpage.

b.     It allows web developers to specify alternative text (alt) for accessibility, as well as control dimensions and alignment.

3. What is an ordered list?

Answer: An ordered list is a type of HTML list used to display items in a specific numerical or alphabetical sequence (usually marked with numbers, letters, or Roman numerals) using the <ol> tag.

Answers to the HTML Exercise

4. List any two properties of the <img> tag.

·         Answer:

1.     src: Specifies the source path or URL of the image file.

2.     alt: Provides alternative text description for the image if it fails to load or for accessibility.


5. What is the difference between ordered and unordered lists?

Answer:

o    Ordered List (<ol>): Displays items in a specific sequential order using numbers, letters, or Roman numerals.

o    Unordered List (<ul>): Displays items in no particular numerical order, typically marked with bullet points (like discs, circles, or squares).

6. What are the different attributes of <video> tag?

Answer:

o    src: Specifies the URL of the video file.

o    controls: Displays video playback controls (like play, pause, and volume).

o    autoplay: Starts playing the video automatically as soon as it is loaded.

o    loop: Makes the video restart automatically every time it finishes.

o    muted: Mutes the audio output of the video by default.



Comments

Popular posts from this blog

TYPES OF HARDWARE CLASS IX

CLASS X SYLLABUS 2026-27

Computer Applications Class IX Types of Software (Chap 3)