css - 如何在css中制作这个点菜单?
问题描述
我想用点制作菜单按钮:
这是我的按钮 css:
.popup-btn
height: 35px
width: 35px
border-radius: 50%
background: gray
谢谢
解决方案
您可以使用box-shadow和Pseudo-elements
div{
width: 32px;
height: 32px;
background: black;
margin: 20px auto;
border-radius: 50%;
position:relative;
}
div:before{
content: "";
position: absolute;
left: 50%;
top: 6px;
margin-left: -2px;
background: hsl(0, 0%, 100%);
border-radius: 50%;
width: 4px;
height: 4px;
box-shadow: 0px 8px white, 0px 16px white;
}
<div></div>
推荐阅读
- react-native - 更改子组件的 props 值导致渲染过多
- matlab - Matlab:细胞结肠的新希望?
- reactjs - 在 Ubuntu 20.04 中安装 mongoDB 失败
- google-apps-script - 谷歌脚本编辑器:通过动态“X”复制和粘贴特定数据范围?
- javascript - 为什么 getElementById 不被识别?
- python - 如何在 numpy python 中用 antoher 增加一个向量
- google-apps-script - 用户对此配置文件没有足够的权限。- 谷歌分析 API v4
- sql-server - 在同步提交模式下使用只读副本,查询是否有可能在辅助节点上获得与主节点不同的结果?
- mapstruct - mapstruct空检查导致spotbug错误
- php - 我怎样才能给其他数组值键与指定数组相同?