Computer ScienceNEB 2076 (old course)
Explain the <OL tag and <img tag with its properties and values. [2.5+2.5]
5Answer
Explanation of <OL> and <img> Tags with Properties and Values
1. <OL> Tag (Ordered List)
The <OL> tag in HTML is used to create an ordered list (numbered list). Each list item inside <OL> is marked with a number by default, starting from 1.
Syntax:
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Key Properties and Attributes:
| Attribute | Description | Example Values |
|---|---|---|
type |
Specifies the type of numbering | 1 (default), A, a, I, i |
start |
Sets the starting number of the list | start="5" (starts from 5) |
reversed |
Reverses the order of numbering | reversed (counts down) |
Example:
<ol type="A" start="10">
<li>First item</li>
<li>Second item</li>
</ol>
Output:
A. First item
B. Second item
2. <img> Tag (Image)
The <img> tag in HTML is used to embed an image in a webpage. It is a self-closing tag and must include the src attribute to specify the image source.
Syntax:
<img src="image.jpg" alt="Description">
Key Properties and Attributes:
| Attribute | Description | Example Values |
|---|---|---|
src |
Specifies the path of the image | src="logo.png" |
alt |
Provides alternative text for accessibility | alt="Company Logo" |
width |
Sets the width of the image | width="200" |
height |
Sets the height of the image | height="100" |
title |
Displays a tooltip when hovering | title="Click to zoom" |
loading |
Controls lazy loading | loading="lazy" |
Example:
<img src="mountain.jpg" alt="Beautiful Mountain" width="300" height="200" title="Click to view">
Best Practices:
- Always include the
altattribute for accessibility. - Use relative or absolute paths for
src. - Optimize image size to improve page loading speed.
Discussion
Loading…
More Computer Science questions
What is Boolean algebra ? Describe AND and NAND gates with logic symbol, truth table and Venn diagram. [4+6]NEB 2076 (old course)10Draw the block diagram of computer system. Explain the input and processing units. [4+6]NEB 2076 (old course)10What is Operating System (OS) ? Describe its functions in brief. [2+8]NEB 2076 (old course)10What is programming language ? Describe the various types of programming language with their merits and demerits. [2+8] GROUP: B Short answer questions 9 × 5…NEB 2076 (old course)10Differentiate between analog and digital computer.NEB 2076 (old course)5Convert (513) 10 Decimal number to (..) 2 Binary number.NEB 2076 (old course)5