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 |
Centering a div in a page, basic | 1,500 Kb |
Centering a div within a div, old-school | 1,575 Kb |
Fixing a div to the bottom of a page | 2,671 Kb |
Centering a div in a page, responsive | 1,584 Kb |
Centering a div within a div, inner div responsive | 1,609 Kb |
Fixing a div to the horizontal and vertical center of the viewport | 2,682 Kb |
Fixing a div, basic | 2,004 Kb |
Centering a div at the bottom of a page | 1,586 Kb |
Fixing a div to the horizontal center of a page | 1,984 Kb |
Fixing a div to the right of a page | 1,962 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 |
Twitch API | Coderpilot | 3,412 Kb |
Shopping List | Markmurray | 6,015 Kb |
AOR site logo | Thatbram | 2,527 Kb |
Simple DevTools | Deegill | 2,511 Kb |
Custom Checkbox and radio inputs SCSS | Rgfx | 3,367 Kb |
Infractions - Attitude | Kylie_Joseph | 7,672 Kb |
Material design - button rainbow circle | Kunukn | 3,652 Kb |
A Pen by Taylor Vowell | Taylorvowell | 5,962 Kb |
Subtle site navigation with description | Necks | 3,206 Kb |
Faux column absolute wrapper | Yurimorini | 1,823 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!