0% found this document useful (0 votes)
44 views5 pages

Q2) Define The Following:: A) List-Style-Position Property

Uploaded by

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

Q2) Define The Following:: A) List-Style-Position Property

Uploaded by

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

Q2) Define the following:

a) List-style-position property
The list-style-position CSS property sets the position of the list marker (bullet or number)
in the list items. It can have two values:

 inside: The marker is placed inside the list item, and the text wraps around it.
 outside: The marker is placed outside the list item, and the text does not wrap around it.

Example:

<ul style="list-style-position: inside;">


<li>Item inside</li>
</ul>

<ul style="list-style-position: outside;">


<li>Item outside</li>
</ul>

b) autoplay attribute of <audio> tag


The autoplay attribute of the <audio> tag specifies that the audio file should start playing
automatically as soon as it is loaded. If the attribute is present, the audio will play without
requiring user interaction.

Example:

<audio src="audio.mp3" autoplay></audio>

c) a

property
The a:hover CSS pseudo-class applies styles to a hyperlink when the user hovers over it with
their mouse pointer. This is commonly used to change the appearance of links to provide visual
feedback to users that the link is interactable.

Example:

<a href="https://example.com" style="color: blue;">Normal link</a>


<a href="https://example.com" style="color: blue;"
onmouseover="this.style.color='red';"
onmouseout="this.style.color='blue';">Hover link</a>

CSS Example:

a {
color: blue;
}

a:hover {
color: red;
}

d) Hyperlink
A hyperlink, or simply a link, is an HTML element that allows users to navigate from one page
to another, either within the same website or to a different website. Hyperlinks are created using
the <a> (anchor) tag, and the href (hypertext reference) attribute specifies the URL of the page
the link goes to. When a user clicks on the hyperlink, they are taken to the specified URL.

Example:

<a href="https://www.example.com">Visit Example.com</a>

In this example, clicking the text "Visit Example.com" will take the user to
https://www.example.com.

e) Name attribute of <a> tag


The name attribute of the <a> tag is used to create a named anchor within a page, which can be
linked to from other places in the document. This allows users to jump to specific sections of the
same document by clicking on a hyperlink. This attribute is now deprecated in favor of using the
id attribute for the same purpose.

Example using name attribute:

<a name="section1"></a>
<p>This is Section 1.</p>
<a href="#section1">Go to Section 1</a>

Modern example using id attribute:

<a id="section1"></a>
<p>This is Section 1.</p>
<a href="#section1">Go to Section 1</a>

In both examples, clicking the "Go to Section 1" link will jump to the section marked by the
anchor.

Q3) Answer the following questions:

a) Name and define any four attributes of <table> tag

1. border:
o Defines the width of the border around the table and its cells.
o Example: <table border="1"> creates a table with a 1-pixel border.
2. cellpadding:
o Sets the amount of space between the content of a cell and its border.
o Example: <table cellpadding="10"> adds 10 pixels of padding inside each
cell.
3. cellspacing:
o Sets the amount of space between the borders of adjacent cells.
o Example: <table cellspacing="5"> creates 5 pixels of space between each
cell.
4. width:
o Specifies the width of the table.
o Can be set in pixels or as a percentage of the containing element.
o Example: <table width="100%"> makes the table span the entire width of its
container.

b) Differentiate between ordered and unordered list

 Ordered List (<ol>):


o Displays items in a numbered sequence.
o Each item is defined with a <li> tag, and numbers or letters are automatically
generated.
o Example:

html
Copy code
<ol>
<li>First item</li>
<li>Second item</li>
</ol>

 Unordered List (<ul>):


o Displays items with bullet points.
o Each item is defined with a <li> tag, and bullets are automatically generated.
o Example:

html
Copy code
<ul>
<li>First item</li>
<li>Second item</li>
</ul>

c) What do you understand by SRC attribute?

The src (source) attribute specifies the URL of the resource to be embedded or included in the
document. It is used in various HTML tags, such as:

 <img>: Specifies the path to the image file.


 <audio>: Specifies the path to the audio file.
 <video>: Specifies the path to the video file.
 <iframe>: Specifies the URL of the document to be displayed in the inline frame.

Example:

<img src="image.jpg" alt="Description of the image">


<audio src="audio.mp3" controls></audio>
<iframe src="page.html"></iframe>

d) How do you insert a frame in an HTML document?

Frames can be inserted using the <frameset> and <frame> tags. A <frameset> tag is used to
define the layout of the frames, and the <frame> tag specifies the content of each frame. For
example:

<frameset cols="25%,75%">
<frame src="frame_a.html">
<frame src="frame_b.html">
</frameset>

This example creates a two-column frameset, where the first frame takes 25% of the width and
the second frame takes 75%. Note that frames are deprecated in HTML5, and it is recommended
to use <iframe> for embedding documents.

e) Define <img> tag

The <img> tag is used to embed an image in an HTML document. It is an empty tag that contains
attributes to specify the source of the image, alternative text, dimensions, and other properties.
The src attribute specifies the path to the image file, and the alt attribute provides alternative
text if the image cannot be displayed. For example:

<img src="image.jpg" alt="Description of the image">

Additional attributes like width and height can be used to specify the dimensions of the image:

<img src="image.jpg" alt="Description of the image" width="300" height="200">


4o

Q4) Differentiate between the following (2 points):

a) Cellpadding and Cellspacing

 Cellpadding:
o Adds space between the content of a cell and its border.
o Increases the size of the cell by adding padding inside the cell.
 Cellspacing:
o Adds space between the borders of adjacent cells.
o Creates gaps between cells, affecting the overall table layout.

b) Rowspan and Colspan

 Rowspan:
o Merges cells vertically in a table.
o Attribute of the <td> or <th> tag, specifying the number of rows a cell should
span.
o Example: <td rowspan="2">
 Colspan:
o Merges cells horizontally in a table.
o Attribute of the <td> or <th> tag, specifying the number of columns a cell should
span.
o Example: <td colspan="3">

You might also like