Home > Web Front-end > HTML Tutorial > 兼容所有浏览器的圆角矩形效果代码实例_html/css_WEB-ITnose

兼容所有浏览器的圆角矩形效果代码实例_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:31:21
Original
905 people have browsed it

兼容所有浏览器的圆角矩形效果代码实例:
CSS3中已经给出了非常方便定义圆角的属性,可惜IE浏览器中兼容性很差,这里就不多介绍了,具体可以参阅CSS3实现圆角效果一章节。由于兼容性问题所以要使用一些特别的方法来实现圆角效果,下面就是一段这样的代码实例。
代码如下:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>div+CSS圆角矩形</title><style type="text/CSS">body{  padding:20px;  background-color:#FFF;  font:100.01% "Trebuchet MS",Verdana, Arial,sans-serif}div#nifty{  margin:0 10%;  background:#9BD1FA}p{padding:10px}div.rtop, div.rbottom{  display:block;  background:#FFF}div.rtop div, div.rbottom div{  display:block;  height:1px;  overflow:hidden;  background:#9BD1FA}div.r1{margin: 0 5px}div.r2{margin: 0 3px}div.r3{margin: 0 2px}div.rtop div.r4, div.rbottom div.r4{  margin:0 1px;  height:2px}</style></head><body><div id="nifty">  <div class="rtop">    <div class="r1"></div>    <div class="r2"></div>    <div class="r3"></div>    <div class="r4"></div>  </div>  <p>蚂蚁部落欢迎您!</p>  <div class="rtop">    <div class="r4"></div>    <div class="r3"></div>    <div class="r2"></div>    <div class="r1"></div>  </div></div></body></hmtl>
Copy after login

以上代码虽然较为麻烦一些,但是能够实现圆角效果,还是挺不错的。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=9521

更多内容可以参阅:http://www.softwhy.com/divcss/

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template