cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="shadow shadow1">transform问题</div>
<div class="shadow shadow2">微折角</div>
<div class="shadow shadow3">弯曲阴影</div>
<div class="shadow shadow4">凸起效果</div>
<div class="shadow shadow5"><p>旋转效果</p></div>
<div class="shadow shadow6">hover效果</div>
<div class="shadow shadow7">对角折起</div>
<div class="shadow shadow8">书页效果</div>
<div class="shadow shadow9">黏贴纸效果</div>
            
          
!
            
              .shadow {
	position: relative;
	width: 20%;
	float: left;
	border: 1px solid #ccc;
	height: 100px;
	margin: 20px;
	background: white;
	text-align: center;
	padding-top: 30px;
	box-sizing: border-box;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.1) inset;
}


.shadow::before,
.shadow::after {
  content: "";
  position: absolute;
  z-index: -2;
}

/*=============
	 transform问题
  =============*/
.shadow1 {
  transform: rotate(3deg);
}
.shadow1::before,
.shadow1::after {
	bottom: 15px;
	left: 10px;
	width: 50%;
	height: 20%;
	box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
	transform: rotate(-3deg);
	max-width: 300px;
}

.shadow1::after{
  right: 10px;
  left: auto;
  transform: rotate(3deg);
 }

/*=============
	  微折角
  =============*/
.shadow2::before,
.shadow2::after {
	bottom: 15px;
	left: 10px;
	width: 50%;
	height: 20%;
	box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
	transform: rotate(-3deg);
	max-width: 300px;
}

.shadow2::after{
  right: 10px;
  left: auto;
  transform: rotate(3deg);
 }


/*=============
	折起角效果
  =============*/
.shadow3 {
	border-radius: 0 0 120px 120px / 0 0 6px 6px;
}
.shadow3::before,
.shadow3::after {
	bottom: 15px;
	left: 10px;
	width: 50%;
	height: 20%;
	box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
	transform: rotate(-3deg);
	max-width: 300px;
}

.shadow3::after{
  right: 10px;
  left: auto;
  transform: rotate(3deg);
 }

/*=============
	凸起效果
  =============*/
.shadow4 {
	box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}

/*=============
	旋转效果
  =============*/
.shadow5 {
	transform: rotate(3deg);
}
.shadow5 p {
	margin: 0;
}
.shadow5 p::before {
	content: "";
	position: absolute;
	z-index: -1;
	background: #fff;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.1) inset;
	top: 0;
	bottom: 0;
	right: 0;
	left: 0;
}
.shadow5::before,
.shadow5::after {
	bottom: 15px;
	left: 10px;
	width: 50%;
	height: 20%;
	box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
	transform: rotate(-3deg);
	max-width: 300px;
}

.shadow5::after{
  right: 10px;
  left: auto;
  transform: rotate(3deg);
 }

/*=============
	凸显效果
  =============*/
.shadow6 {
	transition:all 0.3s ease;
}
.shadow6:hover{
	border:1px solid rgba(82, 168, 236, 0.6);
	box-shadow: 0 0 8px rgba(82, 168, 236, 0.6),0 0 40px rgba(0, 0, 0, 0.1) inset;
}

/*=============
	对角折起效果
  =============*/
.shadow7::before{
	content:"";
	width:50%;
	height:50%;
	left:0;
	top:0;
	box-shadow:-20px -30px 15px rgba(0,0,0,0.2);
	transform:skew(10deg,10deg) translate(40px,30px);
}
.shadow7::after{
	content:"";
	width:50%;
	height:50%;
	right:0;
	top:50%;
	box-shadow:20px 30px 15px rgba(0,0,0,0.2);
	transform:skew(10deg,10deg) translate(-40px,-20px);
}

/*=============
	书页效果
	三个框的重叠
  1. 原盒子
  2. before
  3. after
  =============*/
.shadow8{
	background: linear-gradient(100% 50%, #fff, #fff 10%, #f3f3f3);
    border-bottom-right-radius: 60px 5px;
}
.shadow8::before{
	content:"";
	width:98%;
	height:98%;
	left:0;
	top:0;
	background-color:#fff;
	border: 1px solid #ccc;
	transform:skew(4deg, 2deg) translate(6px, 7px);
    border-bottom-right-radius: 60px 5px;
}
.shadow8::after{
	content:"";
	width:98%;
	height:98%;
	left:0;
	top:0;
	background-color:#fff;
	border: 1px solid #ccc;
	transform:skew(3deg, 1deg) translate(4px, 4px);
}
/* 黏贴纸效果 */
.shadow9{
	box-shadow: 0 0 5px rgba(0,0,0,0.3);
}
.shadow9::before{
	content:"";
	width:110px;
	height:30px;
	background-color:rgba(255,255,0,0.2);
	z-index:1;
	top:8px;
	left:-32px;
	box-shadow: 0 0 5px rgba(0,0,0,0.3);
	transform:rotate(-45deg);
}
.shadow9::after{
	content:"";
	width:110px;
	height:30px;
	background-color:rgba(255,255,0,0.2);
	z-index:1;
	bottom:8px;
	right:-32px;
	box-shadow: 0 0 5px rgba(0,0,0,0.3);
	transform:rotate(-45deg);
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console