HTML Figure tag
Figure tag in HTML:
<figure> tag as a little picture frame on your webpage.
It's a way to highlight something that goes along with your main text, but can kind of stand on its own.
Example
The "figure" tag is like a digital frame for visual or multimedia content.
It's used to group and semantically represent self-contained content, often accompanied by a caption.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nature's Beauty</title>
<style>
body {
font-family: 'Arial', sans-serif;
text-align: center;
margin-top: 50px;
font-size: 18px;
}
h1 {
color: #2c3e50; /* Dark gray color for heading */
}
.image {
max-width: 100%;
height: auto;
border-radius: 8px; /* Rounded corners for the image */
margin-top: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Box shadow for a subtle lift */
}
figcaption {
margin-top: 10px;
color: #34495e; /* Dark blue-gray color for caption text */
}
</style>
</head>
<body>
<h1>Nature's Beauty</h1>
<figure>
<img src="sample.jpg" alt="Beautiful landscape" class="image">
<figcaption>A breathtaking view of a serene landscape.</figcaption>
</figure>
</body>
</html>
Try it Yourself »