利用css3的border-radius属性,如:
<div style="width:200px height:100px border:1px solid red border-radius:5px"></div>border-radius的值越大,边角的弧度就越大,将border-radius的值设置为50%的时候,可以将一个正方形变成圆形,如:
<div style="width:200px height:200px border:1px solid red border-radius:50%"></div>用到了这条代码:border-radius-left,top,bottom,right例子如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<div style="border:3px #000 solidborder-top-right-radius:10pxborder-top-left-radius:5pxborder-bottom-left-radius:6pxborder-bottom-right-radius:20pxwidth:50pxheight:50pxbackground:#f60"></div>
<div style="border:3px #000 solidborder-radius:10pxwidth:50pxheight:50pxbackground:#fff"></div>
</body>
</html>