Basic Fullscreen Hero

Developer
Size
3,040 Kb
Views
6,072

How do I make an basic fullscreen hero?

Full screen background image with centered text. What is a basic fullscreen hero? How do you make a basic fullscreen hero? This script and codes were developed by David Klotz on 23 January 2023, Monday.

Basic Fullscreen Hero Previews

Basic Fullscreen Hero - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Basic Fullscreen Hero</title> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scaleable=no"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,300italic,600,600italic,700,700italic,800,800italic'> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ @import url("https://fonts.googleapis.com/css?family=Roboto:300,400,700");
.p-hero { height: 100vh; width: 100vw; position: relative; display: table; overflow: hidden; color: #ffffff;
}
.p-hero .p-hero__overlay { background: rgba(0, 0, 0, 0.3); width: 100%; height: 100vh; position: absolute;
}
.p-hero .p-hero__image { background: url(https://photos.smugmug.com/Public/i-B2zphBP/4/5c5d42e6/O/1440x900.jpg) no-repeat; background-size: cover; background-position: center center;
}
.p-hero .p-hero__content { position: relative; height: 100vh; width: 100%; font-family: "Roboto", sans-serif; /* vertically align its content */ display: table; overflow: hidden;
}
.p-hero .p-hero__content .p-hero__headline { display: table-cell; text-align: center; vertical-align: middle;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="p-hero"> <div class="p-hero__image"> <div class="p-hero__overlay"></div> <div class="p-hero__content"> <div class="p-hero__headline"> <h1>Fullscreen Hero Image</h1> <p>Fullscreen background image with centered text.</p> </div> </div> </div>
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js'></script>
</body>
</html>

Basic Fullscreen Hero - Script Codes CSS Codes

@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,700");
.p-hero { height: 100vh; width: 100vw; position: relative; display: table; overflow: hidden; color: #ffffff;
}
.p-hero .p-hero__overlay { background: rgba(0, 0, 0, 0.3); width: 100%; height: 100vh; position: absolute;
}
.p-hero .p-hero__image { background: url(https://photos.smugmug.com/Public/i-B2zphBP/4/5c5d42e6/O/1440x900.jpg) no-repeat; background-size: cover; background-position: center center;
}
.p-hero .p-hero__content { position: relative; height: 100vh; width: 100%; font-family: "Roboto", sans-serif; /* vertically align its content */ display: table; overflow: hidden;
}
.p-hero .p-hero__content .p-hero__headline { display: table-cell; text-align: center; vertical-align: middle;
}
Basic Fullscreen Hero - Script Codes
Basic Fullscreen Hero - Script Codes
Home Page Home
Developer David Klotz
Username dkdesign
Uploaded January 23, 2023
Rating 3
Size 3,040 Kb
Views 6,072
Do you need developer help for Basic Fullscreen Hero?

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!

David Klotz (dkdesign) Script Codes
Create amazing blog posts with AI!

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!