PROGRAM 3CSS
PROGRAM 3CSS
CSS file
/* Basic styles for h2 and h3 headings */
h2 {
font-family: 'Arial', sans-serif;
font-size: 24px;
color: #4CAF50; /* Green color */
text-align: center;
margin-bottom: 20px;
}
h3 {
font-family: 'Verdana', sans-serif;
font-size: 20px;
color: #FF5722; /* Orange color */
border-bottom: 2px solid #FF5722; /* Underline with border */
padding-bottom: 5px;
margin-top: 10px;
}
a:hover {
color: #FF4500; /* Orange red on hover */
text-decoration: underline; /* Underline on hover */
}
HTML file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Styling Example</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>Main Heading</h2>
<h3>Sub Heading</h3>
<hr>
<p>This is a paragraph with some <span>inline styling</span> applied to it.</p>
<div>
<p>This is a paragraph inside a div. Div elements are styled to provide visual
separation.</p>
<time datetime="2024-08-22">August 22, 2024</time>
<img src="example.jpg" alt="Example Image">
</div>
<a href="https://www.example.com">Visit Example.com</a>
</body>
</html>