HTML Assignment Answers
HTML Assignment Answers
HTML Heading
<!DOCTYPE html>
<html>
<body>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</body>
</html>
HTML Paragraph
<!DOCTYPE html>
<html>
<body>
<p>This is a paragraph.</p>
<p>Created By Saaiem Salaar.</p>
<p>Here's Another One.</p>
</body>
</html>
HTML Link
<!DOCTYPE html>
<html>
<body>
<h1>HTML Links</h1>
<p><a href="https://in.linkedin.com/in/salaarsaaiem525">Visit SAAIEM SALAAR's LinkedIn</a></p>
</body>
</html>
Unordered List
<!DOCTYPE html>
<html>
<body>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</body>
HTML Table
<!DOCTYPE html>
<html>
<body>
<table border="1">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table> </body> </html>
<!DOCTYPE html>
<html>
<body style="background-color:powderblue;">
<p>I am normal</p>
<p style="color:red;">I am red</p>
<p style="text-align:center;">I am centered</p>
<p style="font-size:50px;">I am big</p>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<img src="img_sam.jpg" alt="Image" style="float:right;"/>
</body>
</html>
HTML Form
<!DOCTYPE html>
<html>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<audio controls>
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<br><br>
</body>
</html>
YouTube Hyperlink
<!DOCTYPE html>
<html>
<body>
<p>
<a href="https://www.youtube.com" target="_blank"> Visit YouTube </a>
</p>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<title>Drag and Drop Example</title>
<style>
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>
<div
id="div1"
ondrop="drop(event)"
ondragover="allowDrop(event)">
</div>
<br>
<img
id="drag1"
src="img_logo.gif"
draggable="true"
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Semantic HTML Example</title>
<style>
header, nav, section, footer {
padding: 10px;
margin: 10px;
border: 1px solid #cccccc;
}
nav ul {
list-style-type: none;
padding: 0;
}
nav ul li {
display: inline;
margin-right: 10px;
}
nav ul li a {
text-decoration: none;
color: #0066cc;
}
nav ul li a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<section>
<h2>This is a section</h2>
<p>This is some content within the section.</p>
</section>
<footer>
<p>This is the footer</p>
</footer>
</body>
</html>