html - 如何在CSS中创建彩色圆圈

标签 html css

我在 css 中创建了彩色圆圈。我的问题是左下角的圆圈不起作用。

即使我给 .bottom-left 一些颜色,它也没有显示。

#circle-container
{
  width:100px;
  height:100px
}
.quarter
{
  width:50px;
  height:50px
}
.top-left
{
 border-top-left-radius:50px;
 background:#09f;
  float:left;
}
.top-right
{
  border-top-right-radius:50px;
  background:#666;
  float:right;
}.
bottom-left
{
  border-bottom-left-radius:50px;
  background:#782;
  float:left;
}
.bottom-right
{
  border-bottom-right-radius:50px;
  background:#333;
  float:right;
}
<div id="circle-container">
<div class="quarter top-left"></div>
<div class="quarter top-right"></div>
<div class="quarter bottom-left"></div>
<div class="quarter bottom-right"></div>
</div>

我该如何解决这个问题?

最佳答案

你错过了 ..bottom-left 类中

你这样写

bottom-left
{

}

但是你必须这样写

.bottom-left
{

}

关于html - 如何在CSS中创建彩色圆圈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40780558/

相关文章:

html - 由于位置为 :absolute which is outside of the page 的 DIV,禁用水平滚动条

java - 如何在Java中获取网页上所有<p>标签的字符串值?

html - 扩展 div 表中最后一个单元格的宽度?

css - 盒子里的 trs

javascript - 如何使用javascript从select2输入的多个选定值中获取文本

javascript - 如何为动态表创建弹出窗口

html - Flexbox - 在多列中对齐元素基线

javascript - 使用 JQuery 检测两个旋转的 div 是否发生碰撞

jquery - 默认情况下 Bigtext 的问题

css - 在 Docker 中使用自动构建无法使用 Bootstrap 进行样式化?