No Javascript. Just HTML and CSS.
A Pen by Bubba Smith on CodePen.
No Javascript. Just HTML and CSS.
A Pen by Bubba Smith on CodePen.
| <header> | |
| <h1>Box Shadow</h1> | |
| <p>Page Curl Effect</p> | |
| </header> | |
| <div> | |
| <ul class="box3"> | |
| <li></li> | |
| <li></li> | |
| <li></li> | |
| </ul> | |
| <ul class="box2"> | |
| <li></li> | |
| <li></li> | |
| <li></li> | |
| </ul> | |
| <ul class="box4"> | |
| <li></li> | |
| <li></li> | |
| <li></li> | |
| </ul> | |
| <ul class="box"> | |
| <li></li> | |
| <li></li> | |
| <li></li> | |
| </ul> | |
| </div> |
| /* Source: http://matthamm.com/box-shadow-curl.html*/ | |
| /* Coding for ".box" was from the "Source" above. I am proud of myself on this Pen though...I was able to look at the CSS and figure out how to make the box-shadow effects on the other 3 boxes. I also added some formating to the body, header, etc. to finish the presentation of the Pen. */ |
| /*Style CSS*/ | |
| /* -------------------------------- | |
| Primary style | |
| -------------------------------- */ | |
| html * { | |
| -webkit-font-smoothing: antialiased; | |
| -moz-osx-font-smoothing: grayscale; | |
| } | |
| *, *:after, *:before { | |
| -webkit-box-sizing: border-box; | |
| -moz-box-sizing: border-box; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-size: 100%; | |
| font-family: "Bitter", sans-serif; | |
| color: #f5f4ed; | |
| background-color: #e8e8e8; | |
| } | |
| /* -------------------------------- | |
| Main components | |
| -------------------------------- */ | |
| header { | |
| background: #454545; | |
| height: 100px; | |
| text-align: center; | |
| } | |
| header h1 { | |
| font-size: 20px; | |
| font-size: 1.25rem; | |
| font-weight: bold; | |
| font-family: "Open Sans", sans-serif; | |
| text-transform: uppercase; | |
| font-weight: bold; | |
| padding-top: 1.6em; | |
| margin-bottom: .2em; | |
| } | |
| header p { | |
| font-size: 13px; | |
| font-size: 1rem; | |
| color: #707070; | |
| } | |
| @media only screen and (min-width: 1024px) { | |
| header { | |
| height: 200px; | |
| } | |
| header h1 { | |
| font-size: 30px; | |
| font-size: 1.875rem; | |
| padding-top: 2.6em; | |
| } | |
| } | |
| main p { | |
| font-size: 16px; | |
| font-size: 1rem; | |
| line-height: 1.6; | |
| margin: 2em 0; | |
| } | |
| @media only screen and (min-width: 1024px) { | |
| main p { | |
| font-size: 20px; | |
| font-size: 1.25rem; | |
| } | |
| } | |
| /* My Tweaks - Center the boxes on the page */ | |
| div { | |
| width:846px; | |
| height:400px; | |
| padding-top: 40px; | |
| margin: 0 auto; | |
| } | |
| div, header { | |
| box-sizing:border-box; | |
| -moz-box-sizing:border-box; | |
| } | |
| /* Source: http://matthamm.com/box-shadow-curl.html */ | |
| ul.box, ul.box2, ul.box3, ul.box4 { | |
| position: relative; | |
| z-index: 1; /* prevent shadows falling behind containers with backgrounds */ | |
| overflow: hidden; | |
| list-style: none; | |
| margin: 0; | |
| padding: 0; } | |
| ul.box li, ul.box2 li, ul.box3 li, ul.box4 li { | |
| position: relative; | |
| float: left; | |
| width: 250px; | |
| height: 150px; | |
| padding: 0; | |
| border: 1px solid #efefef; | |
| margin: 0 30px 30px 0; | |
| background: #fff; | |
| -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset; | |
| -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset; | |
| box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset; } | |
| ul.box li:before, | |
| ul.box li:after, | |
| ul.box2 li:after, | |
| ul.box2 li:before, | |
| ul.box4 li:after { | |
| content: ''; | |
| z-index: -1; | |
| position: absolute; | |
| left: 10px; | |
| bottom: 10px; | |
| width: 70%; | |
| max-width: 300px; /* avoid rotation causing ugly appearance at large container widths */ | |
| max-height: 100px; | |
| height: 55%; | |
| -webkit-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); | |
| -moz-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); | |
| box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); | |
| -webkit-transform: skew(-15deg) rotate(-6deg); | |
| -moz-transform: skew(-15deg) rotate(-6deg); | |
| -ms-transform: skew(-15deg) rotate(-6deg); | |
| -o-transform: skew(-15deg) rotate(-6deg); | |
| transform: skew(-15deg) rotate(-6deg); } | |
| ul.box li:after, | |
| ul.box4 li:after { | |
| left: auto; | |
| right: 10px; | |
| -webkit-transform: skew(15deg) rotate(6deg); | |
| -moz-transform: skew(15deg) rotate(6deg); | |
| -ms-transform: skew(15deg) rotate(6deg); | |
| -o-transform: skew(15deg) rotate(6deg); | |
| transform: skew(15deg) rotate(6deg); } |