BRAHMASTRA/ ब्रह्मास्त्र
1. Explain the basic layout of the HTML document with at least two example
2. How can you apply hyperlink to a text explain the tag use with its attribute of the
same
3. How can you create a nested web page in HTML write a code to support your answer
4. Write an HTML document to create a web page with the help of formatting tag
5. Explain different HTML tags with its attribute that is used to create a tabular
structure in a web page
6. Write a code in HTML to embed and image in a background and at a notification in
the same page
7. Explain the attribute of font tag with examples also discuss image tag with its
attribute
8. Explain any two tag that can be used for the division of web page into various section
9. How can you create a list in HTML explain different type of list present in HTML with
an example of a definition
Answers—
1. **Basic Layout of an HTML Document:**
An HTML document has a basic structure consisting of the following elements:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
```
- `<!DOCTYPE html>`: Defines the document type and version of HTML.
- `<html>`: Contains the entire HTML document.
- `<head>`: Contains meta-information about the document.
- `<title>`: Sets the title of the document (displayed in the browser tab).
- `<body>`: Contains the content of the document visible to users.
- `<h1>`: Represents a heading (h1 to h6 for different levels of headings).
- `<p>`: Represents a paragraph.
2. **Hyperlink in HTML:**
To create a hyperlink, you use the `<a>` tag with the `href` attribute:
<a href="https://www.example.com">Link Text</a>
```
- The `href` attribute specifies the URL of the page the link goes to.
3. **Nested Web Page in HTML:**
You can create a nested web page by linking one HTML document to another:
<a href="nested_page.html">Go to Nested Page</a>
```
- This `<a>` tag links to another HTML document called `nested_page.html`, which would
contain its own HTML structure.
4. **Formatting Tags in HTML:**
To apply formatting to text, you can use various tags like `<strong>`, `<em>`, `<u>`, `<s>`,
`<sub>`, `<sup>`, etc. For example:
<strong>Bold Text</strong>
<em>Italic Text</em>
```
5. **Creating a Tabular Structure in HTML:**
To create a table, you use the `<table>`, `<tr>`, `<td>`, and `<th>` tags:
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>
```
- `<table>`: Defines a table.
- `<tr>`: Defines a row in the table.
- `<th>`: Defines a header cell in the table.
- `<td>`: Defines a standard cell in the table.
6. **Embedding an Image in Background and Adding a Notification:**
You can use CSS to set an image as a background and create a notification:
<body style="background-image: url('background.jpg');">
<div class="notification">This is a notification</div>
</body>
```
- The `background-image` property sets the background image of the document.
- The `<div>` tag creates a block-level element for the notification.
7. **Attributes of `<font>` Tag:**
The `<font>` tag is used to specify the font face, size, and color of text. However, it is
deprecated in HTML5. Example:
<font face="Arial" size="4" color="red">Text</font>
```
8. **Attributes of `<img>` Tag:**
The `<img>` tag is used to display an image on a web page. It has attributes like `src`, `alt`,
`width`, and `height`. Example:
<img src="image.jpg" alt="Description" width="100" height="100">
```
9. **Tags for Division of Web Page:**
Two tags commonly used for dividing a web page into sections are `<div>` and
`<section>`. Example:
<div>This is a division</div>
<section>This is a section</section>
```
10. **Creating Lists in HTML:**
HTML supports ordered lists (`<ol>`), unordered lists (`<ul>`), and definition lists (`<dl>`):
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
<ul>
<li>Item A</li>
<li>Item B</li>
</ul>
<dl>
<dt>Definition Term</dt>
<dd>Definition Description</dd>
</dl>
Extra – important
The `<marquee>` tag in HTML is used to create a scrolling piece
of text or image on a webpage. However, it is deprecated in
HTML5, so it's recommended to use JavaScript and CSS for similar
effects. Here's a breakdown of the attributes you can use with the
`<marquee>` tag:
1. **width**: Specifies the width of the marquee.
Example: `width="200"`
2. **height**: Specifies the height of the marquee.
Example: `height="100"`
3. **direction**: Specifies the direction in which the marquee
should scroll (up, down, left, or right).
Example: `direction="left"`
4. **behavior**: Specifies the type of scrolling (scroll, slide,
alternate).
Example: `behavior="scroll"`
5. **scrolldelay**: Specifies how long to delay between each
jump.
Example: `scrolldelay="100"`
6. **scrollamount**: Specifies the speed of the marquee text.
Example: `scrollamount="5"`
7. **loop**: Specifies how many times to loop (default is
INFINITE).
Example: `loop="2"`
8. **bgcolor**: Specifies the background color.
Example: `bgcolor="yellow"`
9. **hspace**: Specifies horizontal space around the marquee.
Example: `hspace="20"`
10. **vspace**: Specifies vertical space around the marquee.
Example: `vspace="10"`
Here's a simple example of using the `<marquee>` tag:
<marquee direction="left" behavior="scroll"
scrollamount="3">Scrolling Text</marquee>