css实现盒子的四个角高亮边框显示

编程入门 行业动态 更新时间:2024-10-05 11:17:32

css实现盒子的四个角高亮<a href=https://www.elefans.com/category/jswz/34/1766074.html style=边框显示"/>

css实现盒子的四个角高亮边框显示

效果:

 

代码:

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title><style type="text/css">*{margin: 0;padding: 0;box-sizing: border-box;}html,body {line-height: 1.15;text-align: center;}.container {position: relative;width: 300px;height: 180px;line-height: 180px;margin: 10px;background-color: ;border: 1px solid rgba(25, 186, 139, 0.17);background-color: yellow;}.container::before {position: absolute;top: 0;left: 0;width: 10px;height: 10px;border-left: 2px solid #02A6B5;border-top: 2px solid #02A6B5;content: "";}.container::after {position: absolute;top: 0;right: 0;width: 10px;height: 10px;border-right: 2px solid #02A6B5;border-top: 2px solid #02A6B5;content: "";}#toral{position: absolute;bottom: 0;left: 0;width: 100%;}#toral::before{position: absolute;bottom: 0;left: 0;width: 10px;height: 10px;border-left: 2px solid #02A6B5;border-bottom: 2px solid #02A6B5;content: "";}#toral::after{position: absolute;bottom: 0;right: 0;width: 10px;height: 10px;border-right: 2px solid #02A6B5;border-bottom: 2px solid #02A6B5;content: "";}</style></head><body><div class="container"><div id="toral">华诚荣邦</div></div></body>
</html>

更多推荐

css实现盒子的四个角高亮边框显示

本文发布于:2024-02-14 02:10:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1761334.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:边框   盒子   css   高亮

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!