css无图片实现圆角原理剖析
2011-05-31 01:43
746 查看
<!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/html; charset=utf-8" /> <title>无图片形成圆角框</title> <!--分析,通过像素的描绘来实现圆角的效果,--> <style type="text/css"> * { margin:0px; padding:0px; } body { font-family:Georgia, "Times New Roman", Times, serif; font-size:20px; } .box-round { width:500px; margin:10px auto; } /*余下的4个div会继承他的宽度,这也算是重点之一吧*/ .box-round .content { border:1px solid #000; border-width:0 1px; /*只要左右两边的边框,上下边框各通过上下4个div龙出来*/ background: #096; border-left:1px solid #E2EFFA; } .b1, .b2, .b3, .b4 { border:1px solid #000; border-width:0 1px; height:1px; background:#096; } /*重点,内容高度为1px,左右边框为1px,上下边框为0,形成的是一条宽为(border x 2 + width)的直线,通过将4个div内容背景设置为和主内容区一样,而边框不一样来达到圆角效果*/ .b1 { margin:0 5px; background:#000; } /*最上面的边框margin为5px,高度为1px,上下边框的颜色可以通过在这里设置来实现*/ .b2 { margin:0 3px; height:2px; } /*最上面的边框margin为3px,高度为2px*/ .b3 { margin:0 2px; } /*最上面的边框margin为2px,高度为1px*/ .b4 { margin:0 1px; } /*最上面的边框margin为1px,高度为1px,综上所述 (2+1+1+1 = 5)*/ </style> </head> <body> <div class="box-round"> <div class="b1 clear"></div> <div class="b2 clear"></div> <div class="b3 clear"></div> <div class="b4 clear"></div> <div class="content"> <h1>Mozilla Firefox</h1> <p> Referred to as IE or MSIE, Microsoft launched a web browser. Internet Explorer is the most widely used Web browser, although since 2004 it has lost some market share. In April 2005, it has a market share of about 85%.</p> <p>Internet Explorer is Microsoft's new version of the Windows operating system as an integral part. In an earlier version of the operating system, it is an independent, free of charge. Windows 95 OSR2 from the beginning, it was all tied up as a new version of the Windows operating system in the default browser. However, the recent (2004 ~ 2005), a major update applies only to Windows XP SP2 and Windows Server 2003 SP1. Initially, Microsoft plans and the next version of the Windows operating system release Internet Explorer 7, but Microsoft recently announced that, Internet Explorer 7 in a test version (Beta 1) in the summer of 2005 will be made available to Windows XP SP2 users. In the second half of 2006 released Windows Vista will be bundled with the official version of Internet Explorer 7.0. 2008 on 5 years 3 release of Internet Explorer 8 Beta1.</p> <p>As the first by bundling Windows and gain market share and growing out of major security hole, the implementation of its own inefficient and does not support W3C standards, Internet Explorer has been criticized, but had to admit it for the development of the Internet has contributed to .</p> </div> <div class="b4"></div> <div class="b3"></div> <div class="b2"></div> <div class="b1"></div> </div> </body> </html>
相关文章推荐
- 纯css无图片的边框圆角实现原理
- 不用图片纯css实现圆角的一种方式
- CSS 用图片实现圆角方框(一张图片吆)
- 《MonkeyRunner 原理剖析》第九章-MonkeyImage 实现原理 - 第八节 - MonkeyRunner 和 MonkeyImage 图片操作
- css实现图片圆角,兼容所有浏览器
- CSS无图片实现圆角框
- CSS技巧 — 不使用图片实现圆角、阴影、渐变等功能
- 用CSS实现无图片圆角框
- 图片div+CSS实现圆角技术
- Fresco 图片圆角实现原理及 Android 中图片圆角实现方法
- CSS教程:一张图片实现圆角
- css+div+图片实现高度自适应圆角框
- 使用CSS实现圆角Div(无图片)
- CSS实现图片圆角Box
- CSS圆角表格的实现-无图片
- CSS技巧 — 不使用图片实现圆角、阴影、渐变等功能【转】
- css实现图片圆角 兼容所有浏览器实现代码
- css实现可扩展的图片背景圆角边框,在IE6,IE7,Firefox下通过测试
- HTML+CSS实现圆角矩形(不需要图片)——抄自GTalk
- css无图片实现圆角框