CSS3 border-radius

简介: CSS3 border-radius

  • border-radius 介绍 ```


```


  • border-radius 练习


<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .box { width: 200px; height: 200px; border: 1px solid red; margin: 20px auto; text-align: center; line-height: 200px; color: #ccc; font-size: 50px; } .box:nth-child(1) { border-radius: 100px; } /* 如果是动态高度的话用百分比适配会更合适 */ .box:nth-child(2) { border-radius: 50%; } .box:nth-child(3) { border-radius: 200px 0 0 0; } .box:nth-child(4) { height: 100px; line-height: 100px; border-radius: 100px/50px; } .box:nth-child(5) { width: 100px; border-radius: 50%; } </style> </head> <body> <div class="box">1</div> <div class="box">2</div> <div class="box">3</div> <div class="box">4</div> <div class="box">5</div> </body> </html>


image.png


相关文章
css3中的圆角border-radius
css3中的圆角border-radius
|
前端开发
css:border-radius绘制边框圆角-全圆和椭圆
css:border-radius绘制边框圆角-全圆和椭圆
113 0
css:border-radius绘制边框圆角-全圆和椭圆
CSS 02 border-radius
html: <div class="demo"> </div> css: .demo{ width:200px; heigth:200px; border:1px solid #ccc; background-color:#f66; margin:50px auto; border-radius:50%; // border-radius: 50% 50% 50% 50%; } 画一个半圆 .demo{ width:200px; heigth:200px; border:1px solid #cc
|
前端开发
CSS3中border-radius、box-shadow与gradient那点事儿
border-radius用于添加圆角边框,用处非常广泛。
CSS3中border-radius、box-shadow与gradient那点事儿
|
Web App开发 HTML5 移动开发
HTML5实践 -- 介绍css3中的几个属性:text-shadow、box-shadow 和 border-radius
  转载请注明原创地址:http://www.cnblogs.com/softlover/archive/2012/11/21/2779873.html     今天我们的内容是css3的text-shadow、box-shadow 和 border-radius几个属性的介绍,他能增强页面布局,值得学习。
941 0
|
Web App开发
CSS3 经典教程系列:CSS3 圆角(border-radius)详解
  《CSS3 入门教程系列》前一篇文章详细介绍了 CSS3 RGBA 特性的用法,今天这篇文章我们在一起来看看 CSS3 中用于实现圆角效果的 border-radius 属性的具体用法。   以前制作圆角效果,我们都需要使用多张圆角图片做为背景分别应用到每个角上,我应用最多的就是在需要圆角的元素标签中加四个空标签,然后在每个空标签中应用一个圆角的背景位置,然后在对这几个应用了圆角的标签进行定位到相应的位置,非常繁琐。
1139 0
|
Web App开发 iOS开发 Windows
转载:CSS3 圆角(border-radius)
前缀 例1 例2:无边框 书写顺序 其它 支持性 值:半径的长度 前缀 -moz(例如 -moz-border-radius)用于Firefox -webkit(例如:-webkit-border-radius)用于Safari和Chrome。
699 0
|
Web App开发 前端开发