思無邪 (@Clarke.L) 在 让块保持胶囊样式的两个方法 中发帖
方法一:100vmax
代码简单:
border-radius: 100vmax;
方法二:calc() 与 infinity
border-radius: calc(infinity * 1px);
See the Pen
keep capsule by 思無邪 (@siwuxie)
on CodePen.
这里还使用到了全局的强调色,具体参见 没啥用的CSS小知识!【更新中】