Object-fit and object-position
How do I make an object-fit and object-position?
Testing object-fit and object-position properties and polyfill.http://helloanselm.com/2013/fix-image-resizing-with-object-fit/. What is a object-fit and object-position? How do you make a object-fit and object-position? This script and codes were developed by Joey Hoer on 14 September 2022, Wednesday.
Object-fit and object-position - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>object-fit and object-position</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> <figure class="bg"> <figcaption class="description">background-image</figcaption>
</figure>
<figure> <img src="//i.jyhr.co/cdpn/colors.jpg" /> <figcaption class="description"><img></figcaption>
</figure> <script src='http://jyhr.co/cdpn/modernizr.objectfit.js'></script> <script src="js/index.js"></script>
</body>
</html>
Object-fit and object-position - Script Codes CSS Codes
.bg { background-image: url(//i.jyhr.co/cdpn/colors.jpg); background-position: 50%; background-size: cover;
}
img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; -o-object-position: 50%; object-position: 50%; overflow: hidden;
}
figcaption { position: absolute; bottom: 0.5em; right: 0.5em; font-family: monospace, monospace; color: #fff; background-color: rgba(0, 0, 0, 0.75); padding: 0.5em;
}
figure { position: relative; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; margin: 0;
}
html, body { height: 100%; width: 100%; overflow: hidden; display: -webkit-box; display: -ms-flexbox; display: flex;
}
img, figure { vertical-align: middle;
}
Object-fit and object-position - Script Codes JS Codes
Modernizr.load({ test: Modernizr['object-fit'], nope: ['https://cdn.rawgit.com/anselmh/object-fit/master/dist/polyfill.object-fit.css', 'https://cdn.rawgit.com/anselmh/object-fit/master/dist/polyfill.object-fit.min.js'], complete: function(){ if (!Modernizr['object-fit']) { objectFit.polyfill({ selector: 'img', // this can be any CSS selector fittype: 'cover' // either contain, cover, fill or none }); } }
})
Developer | Joey Hoer |
Username | joeyhoer |
Uploaded | September 14, 2022 |
Rating | 3 |
Size | 2,727 Kb |
Views | 24,288 |
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 |
Responsive Text with Viewport Units | 65,818 Kb |
Dizzy Disks | 2,731 Kb |
CSS Middle Child Selector | 3,337 Kb |
Fluid Hexagonal Grid | 4,453 Kb |
Example SVGZ Data URI | 2,981 Kb |
Perforated Leather Background | 1,723 Kb |
Shift | 5,797 Kb |
Outer Stroke | 5,119 Kb |
SVG Faux-Conical Gradient | 6,531 Kb |
Multi-line Text Fading | 3,580 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 |
Slim Grid SASS SCSS v3.2 | Thesturs | 4,709 Kb |
A Pen by Jonas Bjork | Jonasbjork | 3,115 Kb |
A Pen by Oliver Schafeld | Schafeld | 1,720 Kb |
Segments mouse following | Nosir | 2,909 Kb |
Transitioning application screens with semantically named classes | Djgrant | 3,697 Kb |
Mondrian | Chrisarmstrong | 2,787 Kb |
Donut Chart example - MorrisJS | Capelo | 2,385 Kb |
Twinkling Stars | Ripley6811 | 2,750 Kb |
Bootstrap 4 Gridsystem Demo | Rivella50 | 1,535 Kb |
AOR site logo | Thatbram | 2,527 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!