我们定义右上角的样式,这一步也不难做到,因为定义背景图定义在右上,背景图圆角外部分又不是透明,而是白色,所以白色区盖住cssbox_body的绿色部分. CSS代码
{ padding:0; margin:0; } .cssbox,.cssbox_head{ background: transparent url(http://www.webjx.com/upfiles/20070630/20070630213028_01.png) no-repeat; } .cssbox{ background-position:bottom right; width:380px; margin:20px auto; } .cssbox_head{ background-position:top right; }
浏览器中看到的效果见下图:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <HTML xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE>Untitled Document</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <STYLE type=text/css> { padding:0; margin:0; } .cssbox,.cssbox_head{ background: transparent url(http://www.webjx.com/upfiles/20070630/20070630213028_01.png) no-repeat; } .cssbox{ background-position:bottom right; width:380px; margin:20px auto; } .cssbox_head{ background-position:top right; }
</STYLE> <META content="MSHTML 6.00.2900.2995" name=GENERATOR> </HEAD> <BODY> <DIV class=cssbox> <DIV class=cssbox_head> <H2>标题</H2> </DIV> <DIV class=cssbox_body> <P>内容</P> </DIV> </DIV> </BODY> </HTML>
第三步 经过以上的两步我们已经做了出两个角了,在接着做第三个角,定义在H2中也就是左上角.为了美观一些,我们在H2中加入补白10PX, CSS代码
{ padding:0; margin:0; } .cssbox,.cssbox_head,. cssbox_head h2{ background: transparent url(http://www.webjx.com/upfiles/20070630/20070630213028_01.png) no-repeat;
上一篇: 问题解决:无法载入MYSQL扩展,请检查PHP配置
下一篇: 用CSS打造一个超酷的具有立体感效果的导航
|