欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 前端技术 > CSS >内容正文

CSS

css 不规则边角_如何实现带有边角的CSS边框

发布时间:2025/3/12 CSS 66 豆豆
生活随笔 收集整理的这篇文章主要介绍了 css 不规则边角_如何实现带有边角的CSS边框 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

以下是完整代码,拷贝到编辑器即可使用

html>

带四角的边框

body {

background: #00AB68;

text-align: center;

}

#box {

position: relative;

margin: 120px auto;

width: 400px;

height: 100px;

font-family: KaiTi;

font-size: 18px;

line-height: 100px;

font-weight: bold;

color: #fff;

}

.content {

position: absolute;

width: 100%;

height: 100%;

border: 1px solid #c0c0c0;

}

.content > div {

position: absolute;

width: 10px;

height: 10px;

}

.lt {

left: -3px;

top: -3px;

border-top: 3px solid #c0c0c0;

border-left: 3px solid #c0c0c0;

}

.rt {

right: -3px;

top: -3px;

border-top: 3px solid #c0c0c0;

border-right: 3px solid #c0c0c0;

}

.rb {

bottom: -3px;

right: -3px;

border-bottom: 3px solid #c0c0c0;

border-right: 3px solid #c0c0c0;

}

.lb {

bottom: -3px;

left: -3px;

border-bottom: 3px solid #c0c0c0;

border-left: 3px solid #c0c0c0;

}

人间四月芳菲尽,山寺桃花始盛开。

创作挑战赛新人创作奖励来咯,坚持创作打卡瓜分现金大奖

总结

以上是生活随笔为你收集整理的css 不规则边角_如何实现带有边角的CSS边框的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。