欢迎来到HELLO素材网! 南京网站制作选择顺炫科技
丰富的DIV CSS模版、JS,jQuery特效免费提供下载
当前位置:主页 > 建站教程 > DIVCSS教程 >

div+css无图片实现圆角矩形

发表于2017-11-21 21:18| 次阅读| 来源网络整理| 作者采集侠

摘要:在做页面的时候,很多时候会用圆角矩形来妆点一下,但如果用图片的话,即要用到图片又要用到大量的代码,势必

在做页面的时候,很多时候会用圆角矩形来妆点一下,但如果用图片的话,即要用到图片又要用到大量的代码,势必增加了页面的重量

在页面的时候刚好要用到圆角矩形,于是写了以下方法,分享一下

以下为引用的内容:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>div+css无图片实现圆角矩形</title>

<style type="text/css">

<!--

.RoundedCorner{background:url(../images/loginBg2.gif) 0 0 repeat-x;}

b.rtop, b.rbottom{display:block;background:#ffffff;}

b.rtop b, b.rbottom b{display:block;height: 1px;overflow: hidden;}

b.r1{margin: 0 3px;border-left:1px #DBDBDB solid;border-right:1px #DBDBDB solid;background: #DBDBDB;}

b.r2{margin: 0 2px;border-left:1px #DBDBDB solid;border-right:1px #DBDBDB solid;background:url(../images/loginBg2.gif) 0 -3px repeat-x;}

b.r3{margin: 0 1px;border-left:1px #DBDBDB solid;border-right:1px #DBDBDB solid;background:url(../images/loginBg2.gif) 0 -2px repeat-x;}

.content{border-left:1px #DBDBDB solid;border-right:1px #DBDBDB solid;}

b.r8{margin: 0 3px;border-left:1px #DBDBDB solid;border-right:1px #DBDBDB solid;background: #DBDBDB;}

b.r7{margin: 0 2px;border-left:1px #DBDBDB solid;border-right:1px #DBDBDB solid;}

b.r6{margin: 0 1px;border-left:1px #DBDBDB solid;border-right:1px #DBDBDB solid;}

-->

</style>

</head>

<body>

<div class="RoundedCorner">

<b class="rtop">

<b class="r1"></b>

<b class="r2"></b>

<b class="r3"></b>

</b>

<div class="content">内容...</div>

<b class="rbottom">

<b class="r6"></b>

<b class="r7"></b>

<b class="r8"></b>