In this AffiliateWatch video we break down how to make perfect background images with CSS with 3 lines of code. In this video we work with the Twitter background images from companies listed on AffiliateWatch. A lot of the tutorials and stack overflow answers on background images are out of date.
We go over more up to date CSS properties to handle background images such as "object-fit". This can handle images of all widths and heights without distorting the images. It can work with a simple img tag and does not require JS or any special libraries!
.bg-tw-banner {
object-fit: cover;
max-height: 550px;
width: 100%;
}
We also go over that IE (2% of users, maybe less with bots) does not have support for "object-fit". We address in the video how to handle such use cases if you still want to support IE.
Useful Resources for CSS "Object Fit":
https://developer.mozilla.org/en-US/d...
https://caniuse.com/#feat=object-fit
Host Promos/Free Trials:
Vultr Promo Code $100 + (4 FREE MONTHS HOSTING) - https://www.youtube.com/watch?v=ZHxxG...
SiteGround Promo 60% Off - https://affiliate.watch/go/siteground
Get in Touch:
Affiliate Watch Home Page: https://affiliate.watch
Twitter: https://twitter.com/AffiliateWatch1
Facebook: https://facebook.com/affiliatewatch
Instagram: https://instagram.com/affiliatewatch
Medium: https://medium.com/@AffiliateWatch
We go over more up to date CSS properties to handle background images such as "object-fit". This can handle images of all widths and heights without distorting the images. It can work with a simple img tag and does not require JS or any special libraries!
.bg-tw-banner {
object-fit: cover;
max-height: 550px;
width: 100%;
}
We also go over that IE (2% of users, maybe less with bots) does not have support for "object-fit". We address in the video how to handle such use cases if you still want to support IE.
Useful Resources for CSS "Object Fit":
https://developer.mozilla.org/en-US/d...
https://caniuse.com/#feat=object-fit
Host Promos/Free Trials:
Vultr Promo Code $100 + (4 FREE MONTHS HOSTING) - https://www.youtube.com/watch?v=ZHxxG...
SiteGround Promo 60% Off - https://affiliate.watch/go/siteground
Get in Touch:
Affiliate Watch Home Page: https://affiliate.watch
Twitter: https://twitter.com/AffiliateWatch1
Facebook: https://facebook.com/affiliatewatch
Instagram: https://instagram.com/affiliatewatch
Medium: https://medium.com/@AffiliateWatch
CSS PERFECT Background Images (3 LINES OF CODE) | |
118 views views | 536 followers |
8 Likes | 8 Dislikes |
People & Blogs | Upload TimePublished on 22 Sep 2018 |
No comments:
Post a Comment