我想在白色圆圈内放置一个图标来表示切换是什么,但我无法让图标显示在正确的位置,更不用说跟随圆圈的位置了。我一直在尝试使用 Font Awesome 图标。
其中任何一个都是我的最终目标,但我仍然很难弄清楚如何使其发挥作用。

如果有帮助的话,这就是我正在开发的网站。
这是CSS
/* Toggle Styles */
.toggle-container {
text-align: center;
margin-top: 20px;
margin-bottom: 20px
}
.toggle {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.toggle input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
border-radius: 34px;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: 0.4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px; …Run Code Online (Sandbox Code Playgroud)