html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Three Column Layout</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 40px 20px;
font-family: Arial, sans-serif;
color: #222;
}
.columns {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
max-width: 1200px;
margin: 0 auto;
}
.column {
padding: 24px;
border-radius: 12px;
}
.column:nth-child(1) { background-color: #fce8e6; }
.column:nth-child(2) { background-color: #e6f4ea; }
.column:nth-child(3) { background-color: #e8f0fe; }
.column h2 {
margin: 0 0 16px;
font-size: 1.5rem;
}
.column img {
display: block;
width: 100%;
aspect-ratio: 4 / 3;
object-fit: cover;
border-radius: 8px;
}
.column p {
margin: 16px 0 0;
line-height: 1.6;
}
@media (max-width: 768px) {
.columns {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<main class="columns">
<article class="column">
<h2>First heading</h2>
<img src="image-one.jpg" alt="Description of the first image">
<p>Add the text for your first column here.</p>
</article>
<article class="column">
<h2>Second heading</h2>
<img src="image-two.jpg" alt="Description of the second image">
<p>Add the text for your second column here.</p>
</article>
<article class="column">
<h2>Third heading</h2>
<img src="image-three.jpg" alt="Description of the third image">
<p>Add the text for your third column here.</p>
</article>
</main>
</body>
</html>