Object-fit cover
How do I make an object-fit cover?
What is a object-fit cover? How do you make a object-fit cover? This script and codes were developed by Camilla Knap on 29 November 2022, Tuesday.
Object-fit cover - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>object-fit cover</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="wrap1"><img src="http://dummyimage.com/800x800/000/fff&text=object-fit: cover;"/></div>
<div class="wrap2"><img src="http://dummyimage.com/800x800/000/fff&text=position: absolute;"/></div>
<div class="wrap3" style="background-image: url('http://dummyimage.com/800x800/000/fff&text=background: cover;')"> </div>
</body>
</html>
Object-fit cover - Script Codes CSS Codes
div { margin-bottom: 10px;
}
.wrap1 { height: 300px; width: 50%;
}
.wrap1 > img { object-fit: cover; display: block; width: 100%; height: 100%;
}
.wrap2 { position: relative; overflow: hidden; height: 300px; width: 50%;
}
.wrap2 > img { position: absolute; left: -9999px; right: -9999px; top: -9999px; bottom: -9999px; margin: auto; min-width: 100%; min-height: 100%;
}
.wrap3 { height: 300px; width: 50%; background-size: cover; background-position: center center;
}
Developer | Camilla Knap |
Username | clknap |
Uploaded | November 29, 2022 |
Rating | 3 |
Size | 2,249 Kb |
Views | 12,144 |
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 testing margin auto compared to flex-grow | 2,426 Kb |
A Pen by Camilla Knap | 2,747 Kb |
Input label placeholder animation | 3,854 Kb |
Css3 loader | 2,391 Kb |
Responsive table styling | 2,891 Kb |
Morph content | 3,658 Kb |
CSS only accordion | 5,327 Kb |
Input label animation | 3,576 Kb |
Checkbox tag | 2,679 Kb |
A Pen by Camilla Knap | 2,974 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 |
Preloader | Rikki_Sixx | 2,815 Kb |
AngularJS Skills | Supro | 3,312 Kb |
Smoke Shader - Frame Buffer | Omarshe7ta | 2,672 Kb |
A Pen by utcwebdev | Utcwebdev | 2,856 Kb |
Flexbox slider | Rendro | 3,459 Kb |
Image Stack Test SCSS | CalvinMorett | 2,799 Kb |
Lightrays v2 | Sinthetyc | 2,903 Kb |
React Template | Isac | 1,241 Kb |
Wikipedia Viewer | Thalpha | 4,426 Kb |
Basic HTML Slideshow | Tomhodgins | 3,386 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!