HTML Question Answers
HTML Question Answers
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
How to control the line breaks and spaces with the <pre> tag? Explain with examples.
!DOCTYPE html>
<html>
<body>
<pre>
I love myself
I am masterpiece
</pre>
</body>
</html>
<p> My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the
ocean.</p>
Consider the above paragraph lines and apply the proper style formatting tag to set the font
size to 100 px, font family to verdana, text alignment to center, text color to blue.
<h2>Background Image</h2>
What are the various formatting tags in HTML? Explain with examples
<b>
<i>
<u>
<big>
<small>
<sub>
<sup>
<del>
<strong>
<mark>
<ins>
How to use the figure tag in HTML? Explain with codes.
<p>Taj Mahal </p>
<figure>
<img src="htmlpages/images/tajmahal.jpg" alt="Taj Mahal"/>
</figure>
Difference between link tag <link> and anchor tag <a>? Show with example codes.
Refer class 1 HTML notes
How to create a hyperlink in HTML? Write sample code for inserting hyperlink in HTML page.
<!DOCTYPE html>
<html>
<body>
<h2>The href Attribute</h2>
<p>HTML links are defined with the a tag. The link address is specified in the href
attribute:</p>
<a href="https://www.sanjivanicoe.org.in">Visit My College Website</a>
</body>
</html>
Which HTML tag is used to display the data in the tabular form? Write sample code for
inserting the table in HTML page. (2*3 matrix)
<!DOCTYPE html>
<html>
<style>
table, th, td {border:1px solid blue;}
</style>
<body>
<h2>A basic HTML table</h2>
<table style="width:80%">
<tr>
<th>Company</th>
<th>Country</th>
</tr>
<tr>
<td> TCS</td>
<td>India</td>
</tr>
<tr>
<td> wipro</td>
<td>singapore</td> </tr>
</table>
</body>
</html>