Used in casting shadows off block-level elements [like divs]. Using a
negative spread radius, you can get squeeze in a box shadow and only push it off one edge of a box..shadow {
box-shadow: 3px 3px 5px 6px #ccc;
}
Example
Inner shadow
.shadow {
box-shadow: inset 0 0 10px #f8a100;
}
Example
One-side only
.one-edge-shadow {
box-shadow: 0 8px 6px -6px black;
}
Browser support
Desktop
ChromeFirefoxIEEdgeSafari 4*
3.5*
9
12
5*
Mobile / Tablet
106 | 105 | 4 | 4.0-4.1* |
Internet Explorer box shadow
You need extra elements…
Box-shadowed element
.shadow1 {
margin: 40px;
background-color: rgb[68,68,68]; /* Needed for IE */
box-shadow: 5px 5px 5px rgb[68 68 68 / 0.6];
filter: progid:DXImageTransform.Microsoft.Blur[PixelRadius=3,MakeShadow=true,ShadowOpacity=0.30];
-ms-filter: "progid:DXImageTransform.Microsoft.Blur[PixelRadius=3,MakeShadow=true,ShadowOpacity=0.30]";
zoom: 1;
}
.shadow1 .content {
position: relative; /* This protects the inner element from being blurred */
padding: 100px;
background-color: #ddd;
}
More information
- CSS Backgrounds and Borders Module Level 3 specification [W3C]
- CSS Tip: Multicolor & Cutout Drop Shadows [DigitalOcean]
Description
The image come or cause to come gradually into or out of view, or to merge into another shot.
Syntax
@keyframes fadeIn { 0% {opacity: 0;} 100% {opacity: 1;} }
Parameters
Transform − Transform applies to 2d and 3d transformation to an element.
Opacity − Opacity applies to an element to make translucence.
Example
.animated { background-image: url[/css/images/logo.png]; background-repeat: no-repeat; background-position: left top; padding-top:95px; margin-bottom:60px; -webkit-animation-duration: 10s; animation-duration: 10s; -webkit-animation-fill-mode: both; animation-fill-mode: both; } @-webkit-keyframes fadeIn { 0% {opacity: 0;} 100% {opacity: 1;} } @keyframes fadeIn { 0% {opacity: 0;} 100% {opacity: 1;} } .fadeIn { -webkit-animation-name: fadeIn; animation-name: fadeIn; } Reload page function myFunction[] { location.reload[]; }
Output
It will produce the following result −
css_animation.htm
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.
Copyright 1999-2022 by Refsnes Data. All Rights Reserved.
W3Schools is Powered by W3.CSS.