时间:2021-07-01 10:21:17 帮助过:7人阅读
这是html部分:
<div id="beauty-boxes">Some example text</div>
CSS代码
#beauty-boxes{ transition: all 0.5s ease; position:relative; float:left; width:45%; padding:2px; margin:3px; background:#fff; -webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0), 0 0 40px rgba(0, 0, 0, 0) inset; -moz-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0) inset; box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0) inset; -moz-border-radius:4px; border-radius:4px; } #beauty-boxes:before, #beauty-boxes:after { content:""; position:absolute; z-index:-3; bottom:15px; left:12px; width:50%; height:20%; max-width:350px; max-height:90px; -webkit-box-shadow:0 15px 10px rgba(0, 0, 0, 0.7); -moz-box-shadow:0 15px 10px rgba(0, 0, 0, 0.7); box-shadow:0 15px 10px rgba(0, 0, 0, 0.7); -webkit-transform:rotate(-3deg); -moz-transform:rotate(-3deg); -ms-transform:rotate(-3deg); -o-transform:rotate(-3deg); transform:rotate(-3deg); } #beauty-boxes:after { right:10px; left:auto; -webkit-transform:rotate(3deg); -moz-transform:rotate(3deg); -ms-transform:rotate(3deg); -o-transform:rotate(3deg); transform:rotate(3deg); }.beauty-boxes p { font-size:16px; font-weight:bold; } #beauty-boxes:hover{ background-color:#161616; color:#fff; }
效果如下:
以上就是如何实现一个特殊的单面css框效果(代码实例)的详细内容,更多请关注Gxlcms其它相关文章!