html - 在圆形上展开背景

标签 html css

我正在尝试做一个从中心扩展颜色的圆圈,我希望它以 border-radius: 50% 扩展它,如果你看了这个例子你就会明白我在说什么我做了

Checkout the sample i made for better understanding

感谢您的帮助

最佳答案

您可以在插入的box-shadow 上运行transition,就像这样

div {
  width: 300px;
  height: 300px;
  display: flex;
  color: #FFF;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: #03BF60;
  cursor: pointer;
  transition: box-shadow .75s 0s, color .5s 0s;
  box-shadow: inset 0 0 0 0 #DCEDC8;
}

div p { 
  color: inherit;
  text-align: center;
}

div:hover {
  color: #444;
  box-shadow: inset 0 0 0 150px #DCEDC8;
}
<div>
  <p>
     Responsive design. I get this certificate by 
     learning HTML, CSS, web design, media query plus 
     animations using keyframes, declaring variables 
     on css and a lot of CSS components.
  </p>
</div>

关于html - 在圆形上展开背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55224708/

相关文章:

javascript - jquery 中的 for 循环 <p> 标签

Google 表格列上的 CSS

CssStyleHelper 计算值对于查找值失败(-fx-cursor)

javascript - 使用 JQuery for 循环创建 <div> 网格

html - 伪类 :current

javascript - 使用 JavaScript 动态生成的选择选项下拉菜单

javascript - 检测隐藏表单域的变化

html - 先行放元素,再放列

jquery - 使用 jquery 选择一个单选按钮

html - Firefox 中的 CSS 对 Angular 边框别名