Develop an external style sheet named as “style.css” and provide different styles for h2, h3, hr, p, div, span, time, img & a tags. Apply different CSS selectors for tags and demonstrate the significance of each.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Styled HTML Elements</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>This is an H2 Heading</h2>
<h3>This is an H3 Heading</h3>
<hr>
<p>This is a paragraph with some <span>highlighted text</span> using a span element.</p>
<div>
<p>This paragraph is inside a div element with a background color and padding.</p>
</div>
<time datetime="2024-11-17">November 17, 2024</time>
<p>
Here is an image example:
<img src="Images/vtudeveloperlogo.jpg" alt="Sample Image">
</p>
<p>
Visit my <a href="https://vtudeveloper.in">website</a> for more information.
</p>
</body>
</html>
h2 {
color: blue;
font-size: 24px;
}
h3 {
color: green;
}
hr {
border: 2px solid red;
}
p {
font-size: 18px;
}
div {
background-color: #f0f0f0;
padding: 10px;
}
span {
color: red;
}
time {
font-style: italic;
}
img {
width: 100px;
height: 100px;
}
a {
text-decoration: none;
color: purple;
}
Replay !
Share Your Thoughts