本教程操作环境:windows7系统、CSS3 && HT ML 5版、Dell G3 电 脑。
p+Css制作四分之一圆主要是使用Css3.0中的border-radius这个圆角隐藏属性.利用这一属性,我们可以 画圆,画 半 圆,四分之三圆,四分之一圆 等.以后我会更新……
如何使用border-radius属性,下面是border-radius属性最基本的使用方法:
.round { border-radius: 5px; /* 所有角都使用半径为5px的圆角,此属性为CSS3标准属性 */ -moz-border-radius: 5px; /* Mozilla浏览器的私有属性 */ - webkit -border-radius: 5px; /* Webk IT 浏览器的私有属性 */ border-radius: 5px 4px 3px 2px; /* 四个半径值分别是左上角、右上角、 右下角 和左下角 */ }
@H_ 512 _22@1、用border-radius画圆:
# circle { width: 200px; h ei ght: 200px; background-color: #a72525; -webkit-border-radius: 100px; /*-webkit-border-radius: 100%;*/ }
仔细想想,一个正方形(200*200),里面最大的圆是的半径是:100.
2.空心圆代码:空心圆其实就是只有边框,空心部分填上其他颜色:
#circle { width: 200px; height: 200px; background-color: #efefef; /* Can be set to transparent */ border: 3px #a72525 solid; -webkit-border-radius: 100px; }
同理虚线圆代码:
#circle { width: 200px; height: 200px; background-color: #efefef; /* Can be set to transparent */ border: 3px #a72525 dashed; -webkit-border-radius: 100px 100px 100px 100px; }
3.半圆和四分之一圆代码:
#quartercircle { width: 200px; height: 200px; background-color: #a72525; -webkit-border-radius: 200px 0 0 0; }
<!docty PE html> <html> <head> < ;m eta charset="UTF-8"> <meta n am e="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywo rds " content=""> <meta name="Description" content=""> <title>Document</title> <style type="text/css"> #quartercircle{ width: 200px; height: 200px; background-color: #ffffaa; border-radius:0 0 0 200px; -webkit-border-radius: 0 0 0 200px; -moz-border-radius: 0 0 0 200px; -ms-border-radius: 0 0 0 200px; -o-border-radius: 0 0 0 200px; } #quartercircle .dianxuan{ font-f ami ly:Arial; color:gray; font- Size: 25px; padding -t op: 55px; padding-left: 90px; transform:rotate(32 deg ); -ms-transform:rotate(32deg); /* internet E xp lorer */ -moz-transform:rotate(32deg); /* Firefox */ -webkit-transform:rotate(32deg); /* Safari 和 Ch rom e */ -o-transform:rotate(32deg); /* opera */ } </style> </head> <body> <div id="quartercircle"> <div>点选</div> </div> </body> </html>
解释:
-moz(例如 -moz-border-radius)用于Firefox
-webkit(例如:-webkit-border-radius)用于Safari和C hr ome
其中border-radius各个浏览器支持情况如表:
Firefox(2、3+) | √ |
GOOGLE Chrome(1.0.154+…) | √ |
Google Chrome(2.0.156+…) | √ |
Safari(3.2.1+ windows) | √ |
Internet Explorer(IE7, IE8) | × |
Opera 9.6 | × |
(学习视频分享:css视频教程)
以上就是css如何制作圆的详细内容,更多请关注其它相关 文章 !
总结
以上是 为你收集整理的 css如何制作圆 全部内容,希望文章能够帮你解决 css如何制作圆 所遇到的问题。
如果觉得 网站内容还不错, 推荐好友。
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did199608