Based on the provided code, I'll help you create a coupon grid with a responsive design. Here's an example of how you can structure your HTML and CSS to achieve this:
**HTML:**
```html
<div class="CouponGrid">
<div class="SectionTitleRoot">
<h2>Coupon Grid</h2>
</div>
<div class="CNCouponsGrid">
<!-- Coupon cards will be generated dynamically -->
</div>
</div>
```
**CSS:**
```css
.CouponGrid {
max-width: 600px;
margin: 40px auto;
}
.SectionTitleRoot {
text-align: center;
margin-bottom: 20px;
}
.CNCouponsGrid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.coupon-card {
background-color: #f7f7f7;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.coupon-card img {
width: 100%;
height: 150px;
object-fit: cover;
border-radius: 10px 10px 0 0;
}
.coupon-anchor-text {
font-size: 18px;
color: #333;
margin-bottom: 10px;
}
.coupon-button {
background-color: #4CAF50;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}
```
**JavaScript (optional):**
If you want to dynamically generate the coupon cards, you can use JavaScript to populate the grid with data from a database or API.
```javascript
const couponGrid = document.querySelector('.CNCouponsGrid');
const couponsData = [
{
title: 'Squarespace Promo Code',
description: 'Exclusive 10% Off Squarespace',
image: 'https://example.com/logo.png',
link: 'https://www.squarespace.com/',
},
// Add more data here...
];
couponsData.forEach((coupon) => {
const couponCard = document.createElement('div');
couponCard.classList.add('coupon-card');
couponCard.innerHTML = `
<img src="${coupon.image}" alt="${coupon.title}">
<p class="coupon-anchor-text">${coupon.title}</p>
<a href="${coupon.link}" class="coupon-button">Get Coupon</a>
`;
couponGrid.appendChild(couponCard);
});
```
This code generates a basic grid layout with three columns, and each coupon card contains an image, title, description, and a link to get the coupon. You can customize the design and behavior of the grid by modifying the CSS and adding more data to the JavaScript array.
Note that this is just an example, and you'll need to adapt it to your specific use case and requirements.
**HTML:**
```html
<div class="CouponGrid">
<div class="SectionTitleRoot">
<h2>Coupon Grid</h2>
</div>
<div class="CNCouponsGrid">
<!-- Coupon cards will be generated dynamically -->
</div>
</div>
```
**CSS:**
```css
.CouponGrid {
max-width: 600px;
margin: 40px auto;
}
.SectionTitleRoot {
text-align: center;
margin-bottom: 20px;
}
.CNCouponsGrid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.coupon-card {
background-color: #f7f7f7;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.coupon-card img {
width: 100%;
height: 150px;
object-fit: cover;
border-radius: 10px 10px 0 0;
}
.coupon-anchor-text {
font-size: 18px;
color: #333;
margin-bottom: 10px;
}
.coupon-button {
background-color: #4CAF50;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}
```
**JavaScript (optional):**
If you want to dynamically generate the coupon cards, you can use JavaScript to populate the grid with data from a database or API.
```javascript
const couponGrid = document.querySelector('.CNCouponsGrid');
const couponsData = [
{
title: 'Squarespace Promo Code',
description: 'Exclusive 10% Off Squarespace',
image: 'https://example.com/logo.png',
link: 'https://www.squarespace.com/',
},
// Add more data here...
];
couponsData.forEach((coupon) => {
const couponCard = document.createElement('div');
couponCard.classList.add('coupon-card');
couponCard.innerHTML = `
<img src="${coupon.image}" alt="${coupon.title}">
<p class="coupon-anchor-text">${coupon.title}</p>
<a href="${coupon.link}" class="coupon-button">Get Coupon</a>
`;
couponGrid.appendChild(couponCard);
});
```
This code generates a basic grid layout with three columns, and each coupon card contains an image, title, description, and a link to get the coupon. You can customize the design and behavior of the grid by modifying the CSS and adding more data to the JavaScript array.
Note that this is just an example, and you'll need to adapt it to your specific use case and requirements.