HTML Practical 1
HTML Practical 1
210010800018
Exercise 1: Basic HTML Structure Create an HTML document with the following
structure:
Body: Contains a heading (h1) that says "Hello, Polytechnic Students!" and a
paragraph (p) with some introductory text.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
Exerc
Hardik Bakshi
210010800018
ise 2: Links and Images Create an HTML document with a link (a) that goes to a website of your
choice and an image (img) that is displayed on the page.
Solution 2:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>Our Logo</h2>
</body>
</html>
Hardik Bakshi
210010800018
The table should have three columns: Name, Age, and City.
<!DOCTYPE html>
<html>
<head>
<style>
table {
border-collapse: collapse;
width: 50%;
th, td {
padding: 8px;
text-align: left;
th {
background-color: #f2f2f2;
</style>
</head>
<body>
<table>
<tr>
<th>Name</th>
Hardik Bakshi
210010800018
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>John Doe</td>
<td>25</td>
<td>New York</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>30</td>
<td>Los Angeles</td>
</tr>
<tr>
<td>Bob Johnson</td>
<td>22</td>
<td>Chicago</td>
</tr>
</table>
</body>
</html>
Hardik Bakshi
210010800018
Exercise 4: Basic CSS Styling Style the HTML document from Exercise 1 with the
following CSS rules:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: lightblue;
h1 {
color: red;
img {
p{
font-size: 16px;
</style>
</head>
<body>
<h1>Welcome to My Website</h1>
Hardik Bakshi
210010800018
<p>This is my first web page. It's a simple example to get started with HTML and CSS.</p>
</body>
</html>
Hardik Bakshi
210010800018
<html>
<head>
<style>
.form{
</style>
</head>
<fieldset>
<legend>User Information</legend>
<label for="name">Name:</label>
<label for="email">Email:</label>
<label>Area of Interest:</label><br>
Hardik Bakshi
210010800018
<label for="interest1">Technology</label><br>
<label for="interest2">Sports</label><br>
<label for="interest3">Music</label><br><br>
</fieldset>
<fieldset>
<legend>Hobbies</legend>
<label for="hobby1">Reading</label><br>
<label for="hobby2">Traveling</label><br>
<label for="hobby3">Gardening</label><br><br>
</fieldset>
<fieldset>
<legend>Address</legend>
<label for="address">Address:</label><br>
</fieldset>
</form>
Hardik Bakshi
210010800018
</div>
</body>
</html