Backgrounds and the vh unit
How do I make an backgrounds and the vh unit?
This is an example from the blog article Cool stuff with CSS3 vw and vh units at http://www.tipue.com/blog/css3-vw-vh/. What is a backgrounds and the vh unit? How do you make a backgrounds and the vh unit? This script and codes were developed by Steve Pear on 16 September 2022, Friday.
Backgrounds and the vh unit - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Backgrounds and the vh unit </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> <div class="viewport-1"><div class="inner-div"><h1>Viewport background 1</h1></div></div><div class="viewport-2"><div class="inner-div"><h1>Viewport background 2</h1></div></div>
</body>
</html>
Backgrounds and the vh unit - Script Codes CSS Codes
h1
{ font: 18px/1.6 "Open Sans", sans-serif; color: #333; text-transform: uppercase; letter-spacing: 2px; padding: 10px 0; background-color: #fff; text-align: center; border-radius: 2px;
}
.viewport-1
{ background-size: cover; background-image: url('http://www.tipue.com/img/jetty.jpg'); height: 100vh;
}
.viewport-2
{ background-size: cover; background-image: url('http://www.tipue.com/img/dive.jpg'); height: 100vh;
}
.inner-div
{ padding-top: 70px; margin: 0 auto; width: 370px;
}
Developer | Steve Pear |
Username | Tipue |
Uploaded | September 16, 2022 |
Rating | 3.5 |
Size | 1,761 Kb |
Views | 36,432 |
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 |
Flexbox, flexible footer | 1,692 Kb |
Backgrounds and the vw unit | 1,823 Kb |
An example of z-index and stacking order | 1,583 Kb |
Flexbox, spaced out | 1,579 Kb |
Fixing a div to the center of the viewport, CSS3 style | 2,612 Kb |
Backgrounds and the vh unit | 1,761 Kb |
Centering a div within a div, inner div responsive | 1,609 Kb |
Centering a div within a div, old-school | 1,575 Kb |
Fixing a div to the bottom of a page | 2,671 Kb |
Flexbox, big third, third gone | 1,777 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 |
Sitemap generator for Sharepoint | Gyusza | 2,518 Kb |
Minimal Material Design Form Input | Koenigsegg1 | 3,076 Kb |
React Template | Isac | 1,241 Kb |
CSS 3D Radio buttons | Andreasnylin | 1,650 Kb |
Playing with FlexBox | _Billy_Brown | 3,162 Kb |
We Simplify animation | Meodai | 48,169 Kb |
Tile Animation Thing | Frxnz | 4,332 Kb |
A Pen by Bryan | Brydave | 2,286 Kb |
Tab panels | Accessibility | 0 Kb |
Kut D3 | Jellevrswk | 3,687 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!