猿问

css如何实现内凹圆阴影效果

内凹圆带阴影效果要如何实现才好。

千万里不及你
浏览 2949回答 3
3回答

MMMHUHU

左右各自定位一个div

holdtom

效果图: HTML 结构: <body> <div class="content-wrap"> <div class="left-icon"></div> <div class="right-icon"></div> </div> </body> CSS样式:(阴影范围题主可以修改) <style> * { margin: 0; padding: 0; } body { display: flex; justify-content: center; align-items: center; width: 100%; height: 100vh; background-color: #f8f8f8; } .content-wrap { position: relative; width: 500px; height: 800px; background-color: #fff; box-shadow: 0 0 2px 2px lightgray; } .left-icon::before, .right-icon::before { position: absolute; content: ''; top: 300px; width: 40px; padding: 20px 0; border-radius: 50%; box-shadow: 0px 0px 2px 2px lightgray inset; background-color: #f8f8f8; } .left-icon::before { left: -20px; } .right-icon::before { right: -20px; } .left-icon::after, .right-icon::after { position: absolute; top: 300px; content: ''; width: 20px; height: 40px; background-color: #f8f8f8; } .left-icon::after { left: -22px; } .right-icon::after { right: -22px; }
随时随地看视频慕课网APP
我要回答