<div class="custom-hero-container">
<img src="https://images.unsplash.com/photo-1497215728101-856f4ea42174?auto=format&fit=crop&w=1200&q=80" alt="Hero Image" class="hero-bg-image">
<div class="hero-overlay-content">
<h2 class="hero-title">Your Bold Headline Here</h2>
<p class="hero-subtitle">Add your supporting subtext or a brief description of your offer right here.</p>
<a href="https://yourlink.com" class="hero-button">Click Here</a>
</div>
</div>
<style>
.custom-hero-container {
position: relative;
width: 100%;
max-width: 1200px; /* Adjust based on your page width */
margin: 20px auto;
overflow: hidden;
border-radius: 8px;
font-family: sans-serif;
}
.hero-bg-image {
width: 100%;
height: 400px; /* Adjust height as needed */
object-fit: cover;
display: block;
}
/* Darkens image slightly to make text pop */
.custom-hero-container::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
}
.hero-overlay-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
text-align: center;
color: #ffffff;
width: 80%;
}
.hero-title {
font-size: 2.5rem !important;
margin-bottom: 10px !important;
color: #ffffff !important;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.hero-subtitle {
font-size: 1.2rem;
margin-bottom: 25px;
text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.hero-button {
display: inline-block;
padding: 12px 30px;
background-color: #0073aa; /* WordPress Blue */
color: #ffffff !important;
text-decoration: none !important;
border-radius: 5px;
font-weight: bold;
transition: background 0.3s ease;
}
.hero-button:hover {
background-color: #005177;
}
/* Responsive adjustments */
@media (max-width: 600px) {
.hero-title { font-size: 1.8rem !important; }
.hero-bg-image { height: 300px; }
}
</style>