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
Frequently asked questions When you are new to ea...
This article records the installation of MySQL 8....
Solving the problem Bootstrap is a CSS framework ...
1. Back button Use history.back() to create a bro...
How to create a service and auto-start it in Ubun...
Table of contents Preface Single file components ...
Table of contents Mind Map Simple understanding E...
nginx (engine x) is a high-performance HTTP and r...
background The amount of new data in the business...
Diversifying website layouts is our front-end spe...
Linux environment variable configuration When cus...
<br />Previous article: Web Design Tutorial ...
Slow query log related parameters MySQL slow quer...
Preface After installing MySQL and Navicat, when ...
Installation Environment WIN10 VMware Workstation...