用css代码怎么把table的边框变成圆角的。求大神解答

html-css05

用css代码怎么把table的边框变成圆角的。求大神解答,第1张

css3属性

border-radius: 5px

-moz-border-radius: 5px

-webkit-border-radius: 5px

当然这个是不兼容ie9以下的,所以可以找一个border-radius.htc文件,里面是js代码用来兼容旧的IE

css中添加

behavior: url(border-radius.htc)

使用CSS3中的border-radius

table{border-radius:5pxoverflow:hidden}

如果需要单独针对某一个角设置为圆角可以使用下面代码

border-top-left-radius:5em

border-top-right-radius:5em

border-bottom-right-radius:5em

border-bottom-left-radius:5em

第一种

<html xmlns:v>

<head>

<style>

v\:*{behavior: url(#default#VML)}

</style>

</head>

<body>

<v:roundRect style="position:absoluteleft:20pxtop:50pxwidth:200pxheight:140px" FillColor="#e8e8e8" Filled="T" />

刷新本页才能看到效果

</body>

</html>

======================================

第二种

css圆角效果,IE6, firefox均显示正常

<html>

<head>

<title>css圆角效果--网站每日新</title>

<meta http-equiv="content-type" content="text/htmlcharset=gb2312">

<style type="text/css">

div.RoundedCorner{background: #9BD1FA}

b.rtop, b.rbottom{display:blockbackground: #FFF}

b.rtop b, b.rbottom b{display:blockheight: 1pxoverflow: hiddenbackground: #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 1pxheight: 2px}

</style>

</head>

<body>

<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>

</body>

</html>