tubeshowcase●1,674,523 videosβ™‘ My collection 0
← Learn to Code

Learn to Code06:20

Add an overlay to a background-image with one line of CSS

Kevin Powell β†—

From the creator

Looking to take control of your CSS? Check out my course CSS Demystified πŸ‘‰ https://cssdemystified.com/?utm_campaign=general&utm_source=youtube&utm_medium=border-image πŸ”— Links βœ… Temani’s article on border-image: https://www.smashingmagazine.com/2024/01/css-border-image-property βœ… CSS Demystified: https://cssdemystified.com/?utm_campaign=general&utm_source=youtube&utm_medium=border-image βœ… The finished code from this video: https://codepen.io/kevinpowell/pen/yLWNbdJ ⌚ Timestamps 00:00 - Introduction 00:11 - The long way with a pseudo-element 01:00 - Using a border-image instead 03:10 - CSS Demystified 03:42 - The fill keyword 04:20 - Making the gradient transparent 04:50 - Removing the extra space around the image 05:09 - Using the border-image shorthand to make it one line of CSS #css -- Come hang out with other dev's in my Discord Community πŸ’¬ https://discord.gg/nTYCvrK Keep up to date with everything I'm up to βœ‰ https://www.kevinpowell.co/newsletter Come hang out with me live every Monday on Twitch! πŸ“Ί https://www.twitch.tv/kevinpowellcss --- Help support my channel πŸ‘¨β€πŸŽ“ Get a course: https://www.kevinpowell.co/courses πŸ‘• Buy a shirt: https://teespring.com/stores/making-the-internet-awesome πŸ’– Support me on Patreon: https://www.patreon.com/kevinpowell --- My editor: VS Code - https://code.visualstudio.com/ --- I'm on some other places on the internet too! If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me

Published 2024-05-22 Β· Watch on YouTube β†—
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code