To use standard CSS3 to achieve the shadow effect of an element, there are two routines. The first is to use the common 1. Compatibility varies CSS3 2. The same parameter values have different performance effects The filter: drop-shadow(x offset, y offset, blur size, color value); filter:drop-shadow(5px 5px 10px black) Represents a black shadow offset 5 pixels to the lower right and blurred by 10 pixels. Seeing is believing, see the picture below for an illustration. However, if you use box-shadow: 5px 5px 10px black; You will find that the shadow distance of 3. Drop-shadow has no inner shadow effect box-shadow: inset 5px 5px 10px black; However, 4. Shadow vs Box Shadow What does it mean? Let's use CSS border: 10px dashed #fa608d; height: 50px; width: 50px; We then apply box-shadow: 5px 5px 10px black; filter: drop-shadow(5px 5px 10px black); box-shadow: filter:drop-shadow: 6. Practical application of drop-shadow When we implement the floating panel with arrows pointing to it, considering compatibility, the triangles are basically drawn with The arrow has no shadow and can be camouflaged. Now, with CSS code: .box { margin: 40px; padding: 50px; background-color: #fff; position: relative; font-size: 24px; } .cor { position: absolute; left: -40px; width: 0; height: 0; overflow: hidden; border: 20px solid transparent; border-right-color: #fff; } .box-shadow { box-shadow: 5px 5px 10px black; } .drop-shadow { filter: drop-shadow(5px 5px 10px black); } HTML code: <div class="box box-shadow"> <i class="cor"></i> box-shadow </div> <div class="box drop-shadow"> <i class="cor"></i> filter: drop-shadow </div> This is the end of this article about the differences and applications of CSS3 filter: drop-shadow and box-shadow. For more related CSS3 filter: drop-shadow and box-shadow content, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! |
<<: 33 of the best free English fonts shared
>>: JavaScript data flattening detailed explanation
Table of contents Main topic 1. Install Docker on...
0x0 Parameter verification Most of the parameter ...
The application scenario is: the iframe page has n...
1. Linux kernel driver module mechanism Static lo...
Table of contents 1. Basics 2. Problem Descriptio...
Table of contents Two ways to solve the problem o...
CentOS 8 is now available! CentOS 8 and RedHat En...
The simple installation configuration of mysql5.7...
Table of contents 1. Install JDK 2. Install Jenki...
This article uses the "Attribution 4.0 Inter...
Table of contents Manual deployment 1. Create a s...
Background color and transparency settings As sho...
Table of contents How to flatten an array 1. Usin...
Table of contents 1. Pull the image 2. Run the im...
Binlog is a binary log file that is used to recor...