用 border-radius 绘制元素

5年以前  |  阅读数:678 次  |  编程语言:HTML/CSS 
// border-radius主要用于绘制圆点、圆形、椭圆、圆角矩形等形状,以下为简单绘制的两个图形。

.circle,
.ellipse {
  width: 100px;
  height: 100px;
  background: #249ff1;
  border-radius: 50%;
}
.ellipse {
  width: 150px;
  background: #ff9e01;
}

//用法 ;
//<div class="circle"></div>
//<div class="ellipse"><div></div></div>

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8