In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how css creates triangular background images. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
How to create a triangular background image
When we want to show some completely different choices (such as day and night or winter and summer).
This is done by creating two div for the entire viewport, then you need to add a background image to both of them, and then the second div requires a clip-path property to create triangles.
Body {margin: 0; padding: 0;} div {position: absolute; height: 100vh; width: 100vW;} .day {background-image: url ("https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2613&q=80"); background-size: cover; background-repeat: no-repeat }. Night {background-image: url ("https://images.unsplash.com/photo-1493540447904-49763eecf55f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2250&q=80"); background-size: cover; background-repeat: no-repeat; clip-path: polygon (100vw 0,0% 0vh, 100vw 100vh);}
The clip-path property creates a crop region that sets which part of the element should be displayed. The part within the area shows that it is hidden outside the area.
Thank you for reading! This is the end of the article on "how to create triangular background images in css". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.