DIV+CSS圆角边框
无图片实现圆角框
发布日期:2021-07-20 21:49:20
浏览次数:12
分类:技术文章
本文共 6488 字,大约阅读时间需要 21 分钟。
简洁型css圆角:
方法1:
code1:
< style type ="text/css" >
.b1,.b2,.b3,.b4,.b1b,.b2b,.b3b,.b4b,.b{ display:block;overflow:hidden;}
.b1,.b2,.b3,.b1b,.b2b,.b3b{ height:1px;}
.b2,.b3,.b4,.b2b,.b3b,.b4b,.b{ border-left:1px solid #999;border-right:1px solid #999;}
.b1,.b1b{ margin:0 5px;background:#999;}
.b2,.b2b{ margin:0 3px;border-width:2px;}
.b3,.b3b{ margin:0 2px;}
.b4,.b4b{ height:2px;margin:0 1px;}
.d1{ background:#F7F8F9;}
.k { height:300px;}
</ style >
</ head >
< body >
< div >
< b class ="b1" ></ b >< b class ="b2 d1" ></ b >< b class ="b3 d1" ></ b >< b class ="b4 d1" ></ b >
< div class ="b d1 k" >
< font style ="font-size:26px;color:red; margin:0px 10px;" > 简洁型css圆角矩形 </ font >
</ div >
< b class ="b4b d1" ></ b >< b class ="b3b d1" ></ b >< b class ="b2b d1" ></ b >< b class ="b1b" ></ b >
</ div >
.b1,.b2,.b3,.b4,.b1b,.b2b,.b3b,.b4b,.b{ display:block;overflow:hidden;}
.b1,.b2,.b3,.b1b,.b2b,.b3b{ height:1px;}
.b2,.b3,.b4,.b2b,.b3b,.b4b,.b{ border-left:1px solid #999;border-right:1px solid #999;}
.b1,.b1b{ margin:0 5px;background:#999;}
.b2,.b2b{ margin:0 3px;border-width:2px;}
.b3,.b3b{ margin:0 2px;}
.b4,.b4b{ height:2px;margin:0 1px;}
.d1{ background:#F7F8F9;}
.k { height:300px;}
</ style >
</ head >
< body >
< div >
< b class ="b1" ></ b >< b class ="b2 d1" ></ b >< b class ="b3 d1" ></ b >< b class ="b4 d1" ></ b >
< div class ="b d1 k" >
< font style ="font-size:26px;color:red; margin:0px 10px;" > 简洁型css圆角矩形 </ font >
</ div >
< b class ="b4b d1" ></ b >< b class ="b3b d1" ></ b >< b class ="b2b d1" ></ b >< b class ="b1b" ></ b >
</ div >
方法2:
无图片实现圆角框
code2:
< style type ="text/css" >
div.RoundedCorner{ background:#9BD1FA; width:400px;}
b.rtop, b.rbottom{ display:block;background: #FFF}
b.rtop b, b.rbottom b{ display:block;height: 1px;overflow: hidden; background: #9BD1FA}
b.r1{ margin: 0 5px}
b.r2{ margin: 0 3px}
b.r3{ margin: 0 2px}
b.rtop b.r4, b.rbottom b.r4{ margin: 0 1px;height: 2px}
</ style >
< div class ="RoundedCorner" >
< b class ="rtop" >< b class ="r1" ></ b >< b class ="r2" ></ b >< b class ="r3" ></ b >< b class ="r4" ></ b ></ b >
< br > 无图片实现圆角框 < br >< br >
< b class ="rbottom" >< b class ="r4" ></ b >< b class ="r3" ></ b >< b class ="r2" ></ b >< b class ="r1" ></ b ></ b >
</ div >
div.RoundedCorner{ background:#9BD1FA; width:400px;}
b.rtop, b.rbottom{ display:block;background: #FFF}
b.rtop b, b.rbottom b{ display:block;height: 1px;overflow: hidden; background: #9BD1FA}
b.r1{ margin: 0 5px}
b.r2{ margin: 0 3px}
b.r3{ margin: 0 2px}
b.rtop b.r4, b.rbottom b.r4{ margin: 0 1px;height: 2px}
</ style >
< div class ="RoundedCorner" >
< b class ="rtop" >< b class ="r1" ></ b >< b class ="r2" ></ b >< b class ="r3" ></ b >< b class ="r4" ></ b ></ b >
< br > 无图片实现圆角框 < br >< br >
< b class ="rbottom" >< b class ="r4" ></ b >< b class ="r3" ></ b >< b class ="r2" ></ b >< b class ="r1" ></ b ></ b >
</ div >
3D圆角矩形:
3D圆角矩形
CODE:
< style type ="text/css" >
.raised{ background:transparent;width:40%;}
.raised h1,.raised p{ margin:0 10px;}
.raised h1{ font-size:2em;color:#fff;}
.raised p{ padding-bottom:0.5em;}
.raised .b1,.raised .b2,.raised .b3,.raised .b4,.raised .b1b,.raised .b2b,.raised .b3b,.raised .b4b{ display:block;overflow:hidden;font-size:1px;}
.raised .b1,.raised .b2,.raised .b3,.raised .b1b,.raised .b2b,.raised .b3b{ height:1px;}
.raised .b2{ background:#ccc;border-left:1px solid #fff;border-right:1px solid #eee;}
.raised .b3{ background:#ccc;border-left:1px solid #fff;border-right:1px solid #ddd;}
.raised .b4{ background:#ccc;border-left:1px solid #fff;border-right:1px solid #aaa;}
.raised .b4b{ background:#ccc;border-left:1px solid #eee;border-right:1px solid #999;}
.raised .b3b{ background:#ccc;border-left:1px solid #ddd;border-right:1px solid #999;}
.raised .b2b{ background:#ccc;border-left:1px solid #aaa;border-right:1px solid #999;}
.raised .b1{ margin:0 5px;background:#fff;}
.raised .b2, .raised .b2b{ margin:0 3px;border-width:0 2px;}
.raised .b3, .raised .b3b{ margin:0 2px;}
.raised .b4, .raised .b4b{ height:2px; margin:0 1px;}
.raised .b1b{ margin:0 5px; background:#999;}
.raised .boxcontent{ display:block;background:#ccc;border-left:1px solid #fff;border-right:1px solid #999;}
</ style >
</ head >
< body >
< div class ="raised" >
< b class ="b1" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b4" ></ b >
< div class ="boxcontent" >
< h1 > 3D圆角矩形 </ h1 >
</ div >
< b class ="b4b" ></ b >< b class ="b3b" ></ b >< b class ="b2b" ></ b >< b class ="b1b" ></ b >
</ div >
.raised{ background:transparent;width:40%;}
.raised h1,.raised p{ margin:0 10px;}
.raised h1{ font-size:2em;color:#fff;}
.raised p{ padding-bottom:0.5em;}
.raised .b1,.raised .b2,.raised .b3,.raised .b4,.raised .b1b,.raised .b2b,.raised .b3b,.raised .b4b{ display:block;overflow:hidden;font-size:1px;}
.raised .b1,.raised .b2,.raised .b3,.raised .b1b,.raised .b2b,.raised .b3b{ height:1px;}
.raised .b2{ background:#ccc;border-left:1px solid #fff;border-right:1px solid #eee;}
.raised .b3{ background:#ccc;border-left:1px solid #fff;border-right:1px solid #ddd;}
.raised .b4{ background:#ccc;border-left:1px solid #fff;border-right:1px solid #aaa;}
.raised .b4b{ background:#ccc;border-left:1px solid #eee;border-right:1px solid #999;}
.raised .b3b{ background:#ccc;border-left:1px solid #ddd;border-right:1px solid #999;}
.raised .b2b{ background:#ccc;border-left:1px solid #aaa;border-right:1px solid #999;}
.raised .b1{ margin:0 5px;background:#fff;}
.raised .b2, .raised .b2b{ margin:0 3px;border-width:0 2px;}
.raised .b3, .raised .b3b{ margin:0 2px;}
.raised .b4, .raised .b4b{ height:2px; margin:0 1px;}
.raised .b1b{ margin:0 5px; background:#999;}
.raised .boxcontent{ display:block;background:#ccc;border-left:1px solid #fff;border-right:1px solid #999;}
</ style >
</ head >
< body >
< div class ="raised" >
< b class ="b1" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b4" ></ b >
< div class ="boxcontent" >
< h1 > 3D圆角矩形 </ h1 >
</ div >
< b class ="b4b" ></ b >< b class ="b3b" ></ b >< b class ="b2b" ></ b >< b class ="b1b" ></ b >
</ div >
反向css圆角矩形:
反向css圆角矩形
CODE:
< style type ="text/css" >
.serif {
background: transparent; width:40%;
}
.serif h1, .serif p {
margin:0 10px;
}
.serif h1 {
font-size:2em; color:#fff;
}
.serif p {
padding-bottom:0.5em;
}
.serif .b1, .serif .b2, .serif .b3, .serif .b4 {
display:block;
overflow:hidden;
font-size:1px;
}
.serif .b1, .serif .b2, .serif .b3 {
height:1px;
}
.serif .b2, .serif .b3 {
background:#fc0;
border-left:1px solid #fff;
border-right:1px solid #fff;
}
.serif .b4 {
background:#fc0;
border-left:1px solid #fff;
border-right:1px solid #fff;
}
.serif .b1 {
margin:0; background:#fff;
}
.serif .b2 {
margin:0 1px;
border-width:0 2px;
}
.serif .b3 {
margin:0 3px;
}
.serif .b4 {
height:2px;
margin:0 4px;
}
.serif .boxcontent {
display:block;
background:#fc0;
border-left:1px solid #fff;
border-right:1px solid #fff;
margin:0 5px;
}
</ style >
< div class ="serif" >
< b class ="b1" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b4" ></ b >
< div class ="boxcontent" >
< h1 > 反向css圆角矩形 </ h1 >
</ div >
< b class ="b4" ></ b >< b class ="b3" ></ b >< b class ="b2" ></ b >< b class ="b1" ></ b >
</ div >
.serif {
background: transparent; width:40%;
}
.serif h1, .serif p {
margin:0 10px;
}
.serif h1 {
font-size:2em; color:#fff;
}
.serif p {
padding-bottom:0.5em;
}
.serif .b1, .serif .b2, .serif .b3, .serif .b4 {
display:block;
overflow:hidden;
font-size:1px;
}
.serif .b1, .serif .b2, .serif .b3 {
height:1px;
}
.serif .b2, .serif .b3 {
background:#fc0;
border-left:1px solid #fff;
border-right:1px solid #fff;
}
.serif .b4 {
background:#fc0;
border-left:1px solid #fff;
border-right:1px solid #fff;
}
.serif .b1 {
margin:0; background:#fff;
}
.serif .b2 {
margin:0 1px;
border-width:0 2px;
}
.serif .b3 {
margin:0 3px;
}
.serif .b4 {
height:2px;
margin:0 4px;
}
.serif .boxcontent {
display:block;
background:#fc0;
border-left:1px solid #fff;
border-right:1px solid #fff;
margin:0 5px;
}
</ style >
< div class ="serif" >
< b class ="b1" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b4" ></ b >
< div class ="boxcontent" >
< h1 > 反向css圆角矩形 </ h1 >
</ div >
< b class ="b4" ></ b >< b class ="b3" ></ b >< b class ="b2" ></ b >< b class ="b1" ></ b >
</ div >
略带菱形的css圆角:
略带菱形的css圆角矩形
CODE:
< style type ="text/css" >
.curved {
background:transparent;
width:40%;
}
.curved h1, .curved p {
margin:0 10px;
}
.curved h1 {
font-size:2em;
color:#fff;
}
.curved p {
padding-bottom:0.5em;
}
.curved .b1, .curved .b2, .curved .b3, .curved .b4 {
display:block;
overflow:hidden;
height:1px;
font-size:1px;
}
.curved .b2, .curved .b3, .curved .b4 {
background:#e0cea3;
border-left:1px solid #fff;
border-right:1px solid #fff;
}
.curved .b1 {
margin:0 4px;
background:#fff;
}
.curved .b2 {
margin:0 4px;
height:2px;
}
.curved .b3 {
margin:0 3px;
}
.curved .b4 {
margin:0;
height:1px;
border-width:0 3px 0 3px;
}
.curved .boxcontent {
display:block;
background:#e0cea3;
border:0 solid #fff;
border-width:0 1px;
}
</ style >
< div class ="curved" >
< b class ="b1" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b4" ></ b >
< div class ="boxcontent" >
< h1 > 略带菱形的css圆角矩形 </ h1 >
</ div >
< b class ="b4" ></ b >< b class ="b3" ></ b >< b class ="b2" ></ b >< b class ="b1" ></ b >
</ div >
.curved {
background:transparent;
width:40%;
}
.curved h1, .curved p {
margin:0 10px;
}
.curved h1 {
font-size:2em;
color:#fff;
}
.curved p {
padding-bottom:0.5em;
}
.curved .b1, .curved .b2, .curved .b3, .curved .b4 {
display:block;
overflow:hidden;
height:1px;
font-size:1px;
}
.curved .b2, .curved .b3, .curved .b4 {
background:#e0cea3;
border-left:1px solid #fff;
border-right:1px solid #fff;
}
.curved .b1 {
margin:0 4px;
background:#fff;
}
.curved .b2 {
margin:0 4px;
height:2px;
}
.curved .b3 {
margin:0 3px;
}
.curved .b4 {
margin:0;
height:1px;
border-width:0 3px 0 3px;
}
.curved .boxcontent {
display:block;
background:#e0cea3;
border:0 solid #fff;
border-width:0 1px;
}
</ style >
< div class ="curved" >
< b class ="b1" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b4" ></ b >
< div class ="boxcontent" >
< h1 > 略带菱形的css圆角矩形 </ h1 >
</ div >
< b class ="b4" ></ b >< b class ="b3" ></ b >< b class ="b2" ></ b >< b class ="b1" ></ b >
</ div >
特殊CSS圆角:
特殊css圆角矩形
CODE:
< style type ="text/css" >
.pillar {
background:transparent;
width:40%;
}
.pillar h1, .pillar p {
margin:0 10px;
}
.pillar h1 {
font-size:2em;
color:#fff;
}
.pillar p {
padding-bottom:0.5em;
}
.pillar .b1, .pillar .b2, .pillar .b3, .pillar .b4 {
display:block;
overflow:hidden;
font-size:1px;
}
.pillar .b1, .pillar .b2, .pillar .b4 {
height:1px;
}
.pillar .b2, .pillar .b3 {
background:#d66;
border-left:1px solid #fff;
border-right:1px solid #fff;
}
.pillar .b4 {
background:#d66;
border-left:4px solid #fff;
border-right:4px solid #fff;
}
.pillar .b1 {
margin:0 2px;
background:#fff;
}
.pillar .b2 {
margin:0 1px;
border-width:0 1px;
}
.pillar .b3 {
height:2px;
margin:0;
}
.pillar .b4 {
margin:0 2px;
}
.pillar .boxcontent {
display:block;
background:#d66;
border-left:1px solid #fff;
border-right:1px solid #fff;
margin:0 5px;
}
</ style >
< div class ="pillar" >
< b class ="b1" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b2" ></ b >< b class ="b4" ></ b >
< div class ="boxcontent" >
< h1 > 特殊css圆角矩形 </ h1 >
</ div >
< b class ="b4" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b2" ></ b >< b class ="b1" ></ b >
</ div >
.pillar {
background:transparent;
width:40%;
}
.pillar h1, .pillar p {
margin:0 10px;
}
.pillar h1 {
font-size:2em;
color:#fff;
}
.pillar p {
padding-bottom:0.5em;
}
.pillar .b1, .pillar .b2, .pillar .b3, .pillar .b4 {
display:block;
overflow:hidden;
font-size:1px;
}
.pillar .b1, .pillar .b2, .pillar .b4 {
height:1px;
}
.pillar .b2, .pillar .b3 {
background:#d66;
border-left:1px solid #fff;
border-right:1px solid #fff;
}
.pillar .b4 {
background:#d66;
border-left:4px solid #fff;
border-right:4px solid #fff;
}
.pillar .b1 {
margin:0 2px;
background:#fff;
}
.pillar .b2 {
margin:0 1px;
border-width:0 1px;
}
.pillar .b3 {
height:2px;
margin:0;
}
.pillar .b4 {
margin:0 2px;
}
.pillar .boxcontent {
display:block;
background:#d66;
border-left:1px solid #fff;
border-right:1px solid #fff;
margin:0 5px;
}
</ style >
< div class ="pillar" >
< b class ="b1" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b2" ></ b >< b class ="b4" ></ b >
< div class ="boxcontent" >
< h1 > 特殊css圆角矩形 </ h1 >
</ div >
< b class ="b4" ></ b >< b class ="b2" ></ b >< b class ="b3" ></ b >< b class ="b2" ></ b >< b class ="b1" ></ b >
</ div >
转载地址:https://blog.csdn.net/lifan_3a/article/details/8805834 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
关注你微信了!
[***.104.42.241]2024年08月30日 00时53分04秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
5年开发经验的我被几条朋友圈打击到,点燃自己冲击阿里面经!
2019-05-24
5年工作经验的我放弃安逸,一份来自腾讯魔鬼面试的终极考验!
2019-05-24
学JAVA吗同学,这篇Sping boot 确定不了解下么?
2019-05-24
(3年+offer)华为技术岗面试初面+综合面试经验总结
2019-05-24
Python 导包
2019-05-24
dok_matrix
2019-05-24
theano 后端爆内存
2019-05-24
os.environ 和 keras.json
2019-05-24
后台面试经典问题-手写LRU算法
2019-05-24
Deep Residual Learning for Image Recognition
2019-05-24
vue+flask实现视频目标检测yolov5
2019-05-24
关于BigInteger
2019-05-24
UIScrollView不能响应UITouch事件
2019-05-24
iOS TextFiled 文本密码切换 光标偏移解决
2019-05-24
iOS 当前应用所占内存和设备可用内存
2019-05-24
iOS 文件属性
2019-05-24
UIView的layoutSubviews和drawRect方法何时调用
2019-05-24