当然还是用图片,只是可以生成自己所需色彩的图片。
http://www.neuroticweb.com/recursos/css-rounded-box/
将上面生成的图片和下面代码存在同一个文件夹下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>CSS圆角区块容器</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style> .rbroundbox { background: url(nt.gif) repeat; } .rbtop div { background: url(tl.gif) no-repeat top left; } .rbtop { background: url(tr.gif) no-repeat top right; } .rbbot div { background: url(bl.gif) no-repeat bottom left; } .rbbot { background: url(br.gif) no-repeat bottom right; } /* height and width stuff, width not really nessisary. */ .rbtop div, .rbtop, .rbbot div, .rbbot { width: 100%; height: 7px; font-size: 1px; } .rbcontent { margin: 0 7px; } .rbroundbox { width: 50%; margin: 1em auto; } </style> </head> <body> <div class="rbroundbox"> <div class="rbtop"><div></div></div> <div class="rbcontent"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ornare ultricies libero. Donec fringilla, eros at dapibus fermentum, tellus tellus auctor erat, vitae porta magna libero sed libero. Mauris sed leo. Aliquam aliquam. Maecenas vestibulum.</p> </div> <div class="rbbot"><div></div></div> </div> </body> </html>