Given a div with the following background image: Create the following reflection effect: There are many methods, but of course we have to find the fastest and most convenient method, at least no matter how the picture changes or how the Method 1: -webkit-box-reflect This is a very new CSS property that is very simple to use and can reflect our content in all directions. However, the compatibility is too bleak: Basically, only browsers with the -webkit- kernel support it. But it is really convenient to use. The solution is as follows: But it is really convenient to use. The solution is as follows: div{ -webkit-box-reflect: below; } Method 2: inherit, use inheritance This question is mainly to introduce this method, which has good compatibility. What is Flexible use of div:before { content: ""; position: absolute; top: 100%; left: 0; right: 0; bottom: -100%; background-image: inherit; transform: rotateX(180deg); } Summarize This is the end of this article about the method of inheriting CSS properties. For more relevant CSS inheritance content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
<<: Docker container explains in detail how to simplify the image and reduce the size
>>: About converting textarea text to html, that is, carriage return and line break
Preface Merging or splitting by specified charact...
Table of contents Basic syntax for multi-table jo...
1. Find mysqldump.exe in the MySQL installation p...
Introduction to Load Balancing Before introducing...
Classification of color properties Any color can ...
Use self:: or __CLASS__ to get a static reference...
Introduction: Compared with traditional image ver...
This article mainly introduces the implementation...
Most of the time, plug-ins are used to upload fil...
Table of contents Working principle: What does th...
1. Some tips on classes declared with class in re...
1 Overview System centos8, use httpd to build a l...
Knowing that everyone's time is precious, I w...
COALESCE is a function that refers to each parame...
MySQL is the most popular relational database man...