位置阴影翘角
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .box { position: relative; width: 450px; height: 200px; background-color: #3A6682; z-index: -2; margin: 10% auto; } #bian { position: absolute; margin: 25px 25px; width: 400px; height: 150px; background-color: #CCCCCC; text-align: center; border-radius: 3px; } #bian::before, #bian::after { content: ""; position: absolute; width: 100px; height: 20px; bottom: 5%; box-shadow: 0 10px 4px rgba(0, 0, 0, 0.5); border: 1px solid red; z-index: -1; } #bian::before { transform: skew(-16deg, -3deg); left: 4%; } #bian::after { transform: skew(16deg, 3deg); right: 4%; } #bian p { font-size: 12px; margin: 20px 5px 5px; text-align: center; } </style> </head> <body> <div class="box"> <div id="bian"> <p style="font-size: 18px;"><strong>CSS3 Wrapping Drop Shadows</strong></p> <p style="color:rgba(0, 0, 0, 0.5)">With out any minimal extra bullshit markup(You need the first childto be a container element like a header, hgroup or a div). Oh andthey stretch G. Webkit only for now. although lm sure Firefox could do this trick as well.</p> </div> </div> </body> </html>
Document
CSS3 Wrapping Drop Shadows
With out any minimal extra bullshit markup(You need the first childto be a container element like a header, hgroup or a div). Oh andthey stretch G. Webkit only for now. although lm sure Firefox could do this trick as well.