实现CSS3中的border-radius(圆角)

实现边框圆角

-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
behavior: url(border-radius.htc);

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<style type="text/css">
body {
	background-color: #fff;
	font: normal 11pt Trebuchet MS,Arial,sans-serif;
}

.box1 {
	background-color: #f0f0f0;
	width: 533px;
	height: 50px;
	margin: 0 auto 50px auto;
	padding: 20px;
	border: 1px solid #d7d7d7;

	-moz-border-radius: 11px;
	-webkit-border-radius: 11px;
	border-radius: 10px;
	
}

.box2 {
	background: transparent url(ashera.jpg); no-repeat top left;
	width: 420px;
	height: 220px;
	margin: 0 auto 35px auto;
	padding: 30px;
	color: #fff;
	font-weight: bold;
	border: 11px solid #35b70e;

	-moz-border-radius: 32px;
	-webkit-border-radius: 32px;
	border-radius: 32px;
	behavior: url(border-radius.htc);
}

.box3 {
	background-color: #ddd;
	width: 210px;
	height: 30px;
	padding: 20px;
	position: absolute;
	top: 5px; left: 5px;

	-moz-border-radius: 15px;
	-webkit-border-radius: 15px;
	border-radius: 15px;
	behavior: url(border-radius.htc);
}

.rel {
	margin: 50px 0 0 33px;
	padding: 25px;
	position: relative;
	z-index: inherit;
	zoom: 1; /* For IE6 */
}

</style>
</head>
<body>
<p>Not just divs, but any element*</p>
	<div class="rel">
		<div class="box1">
			11 lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet 
		</div>
		<div class="box2">
			22 this cat is a hybrid of domestic and wild breeds :)
		</div>
		<div class="box3">
			33 this box is absolutely positioned
		</div>
	</div>
</body>
</html>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值