当前位置:编程学习 > html/css >>

用DIV+CSS写圆角代码怎么写? 详细点 谢谢!

答案:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>固定宽度</title> <meta http-equiv="content-type" content="text/html; charset=gb2312" /> <style type="text/css" media="screen"> #rounded{ font: 12px/1.6 arial; background: #cba276 url('images/bottom.gif') no-repeat left bottom; width: 280px; padding: 0 0 18px; margin:0 auto; } #rounded h3 { background: url('images/top.gif') no-repeat; padding: 20px 20px 0; font-size: 170%; color: #FFF; line-height: 1; margin: 0; } #rounded p { padding: 10px 20px 0; color: #1B220F; margin: 0; text-indent:2em; } </style> </head> <body> <div id="rounded"> <h3>Fixed Rounded</h3> <p> 这是一个固定宽度的圆角框,由于是固定的宽度,因此制作起来容易和简单很多。这个圆角框的上下随着内容增多可以自由伸展,圆角不会被破坏。</p> <p> 这是一个固定宽度的圆角框,由于是固定的宽度,因此制作起来容易和简单很多。这个圆角框的上下随着内容增多可以自由伸展,圆角不会被破坏。</p> </div> </body> </html> bottom.gif与top.gif分别是底下与上面的圆角的图片
其他:要用到脚本的啊 -moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;
ie6,ie7,ie8不支持,其它都支持的,上面写的是css3 

上一个:CSS div 问题 怎么解决
下一个:div+css中怎样设置水平线的透明度

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,