CSS伪元素:before/CSS伪元素:before/:after content 显示Font Awesome字体图标:after content 显示Font Awesome字体图标...

HTML

CSS

input[type="radio"]:checked + label:before {
                content: "\e659"; // iconfont格式,打开iconfont.css文件里面可以找到
                position: absolute;
                left: 31px;
                top: 2px;
                font-family: "iconfont" !important; // 一定要设置font-family:“iconfont”不然字体无法出来
                color: #2070F7;
                font-size: 14px;
                line-height: 42px;
              }

  

控制台查看:

CSS伪元素:before/CSS伪元素:before/:after content 显示Font Awesome字体图标:after content 显示Font Awesome字体图标..._第1张图片

你可能感兴趣的:(CSS伪元素:before/CSS伪元素:before/:after content 显示Font Awesome字体图标:after content 显示Font Awesome字体图标...)