Full-Width Hero with Image Using Flexbox
How do I make an full-width hero with image using flexbox?
A full-width hero section with background image using flexbox to center the content over the image. It's responsive to the viewport height and width using vh and vw. The content includes a ghost button.. What is a full-width hero with image using flexbox? How do you make a full-width hero with image using flexbox? This script and codes were developed by Brian Haferkamp on 10 October 2022, Monday.
Full-Width Hero with Image Using Flexbox - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Full-Width Hero with Image Using Flexbox</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <header class="hero"> <div class="center-content"> <h1>An Article Title</h1> <h3>A longer subtitle but still important</h3> <a href="#" class="button">Some Action Here</a> </div>
</header>
</body>
</html>
Full-Width Hero with Image Using Flexbox - Script Codes CSS Codes
.hero { background-image: url("https://unsplash.it/1500?random"); background-size: cover; background-position: center; width: 100wh; height: 100vh; display: -webkit-box; display: -ms-flexbox; display: flex;
}
.center-content { width: 400px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: center; -ms-flex-align: center; align-items: center; margin: auto;
}
.center-content h1, .center-content h3 { color: white; line-height: 1;
}
.center-content h1 { text-transform: uppercase; font-size: 3em; margin-bottom: 0; text-align: center;
}
.center-content h3 { margin-bottom: 40px; font-size: 1.5em; font-weight: normal;
}
.button { text-transform: uppercase; color: white; padding: 20px; border: 1px solid white; text-decoration: none;
}
.button:hover { background-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.7); color: white;
}
Developer | Brian Haferkamp |
Username | brianhaferkamp |
Uploaded | October 10, 2022 |
Rating | 3 |
Size | 2,459 Kb |
Views | 34,408 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
2-Up Magazine Layout | 8,250 Kb |
System Fonts Can Be Beautiful | 7,239 Kb |
Creating a CSS Flexbox Grid | 2,022 Kb |
Brutalism Web Design School | 7,231 Kb |
RADIOLOGY | 2,751 Kb |
Emoji-Driven Survey | 5,710 Kb |
Gradient Transitions Between Sections | 3,329 Kb |
Brutal, Bro | 6,575 Kb |
Travel Blog Design with Sticky Nav and Sidebar | 8,383 Kb |
Follow Your Heart | 4,964 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS Letter animations | Sladix | 2,116 Kb |
Buttons with style | Chbymnky | 2,082 Kb |
Rrremark.com Overlay Highlighter | Derickruiz | 4,438 Kb |
Pomodoro Timer | Sdas13 | 2,900 Kb |
Countdown with Rings | Ewganoel | 2,490 Kb |
Ball bouncing loading animation | Adam2326 | 3,144 Kb |
Old calculator | Gnarfugh | 2,815 Kb |
Sitemap generator for Sharepoint | Gyusza | 2,518 Kb |
Polo, the flying squirrel | Agbales | 2,445 Kb |
Heatmap Color Scales | Stevepepple | 2,331 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!