效果如下:
shade box * { margin: 0px; padding: 0px; box-sizing: border-box; font-family: 'Microsoft Yahei'; font-size: 14px; } nav { width: 500px; margin: 10px auto; } .nav { list-style: none; } .nav li { float: left; margin: 0px 5px; } .nav_element { position: relative; } /*过度时间为0.5s*/ .shade { position: absolute; left: 0px; top: 0px; transition: 0.5s; width: 0px; height: 20px; border-radius: 5px 5px; /* 遮罩起始宽度为0 溢出隐藏*/ overflow: hidden; z-index: 1; visibility: hidden; } /*外廓事先已经画好 只是以为父容器宽度为0溢出隐藏不可视而已*/ .outer { position: absolute; left: 0px; top: 0px; width: 60px; height: 20px; border: 1px solid #00a1d6; border-radius: 20px 20px; } /*z-index -1 让外廓可以覆盖此边线*/ .content { border:1px solid #ccc; width: 60px; height: 20px; border-radius: 20px 20px; text-align: center; line-height: 20px; background-color: #fff; position: relative; z-index: -1; }
查看更多关于div+css遮罩层实现边线围绕渐显的特效_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did113948