利用符号字体美化表单元素

 2017年04月23日 分类:HTML5/CSS3/前端设计  评论(0)  阅读(4553)

这几天更新了博客模板,然后空闲时间做了一个利用符号字体美化表单,代码如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Demo-Radio/checked</title>
        <style media="screen">
        @font-face {
            font-family: 'myfont';
            src: url('./fonts/iconfont.ttf');
           /*src: url('./fonts/iconfont.eot');
           src: url('./fonts/iconfont.svg');
           src: url('./fonts/iconfont.woff');*/
        }
        input[type=radio],input[type=checkbox]{
             width: 18px;
             height: 18px;
             display: inline-block;
             background-color: #e9eef2;
             color: #555;clear:
             none;cursor:
             pointer;line-height: 0;
             outline: 0;
             padding: 0 !important;
             text-align: center;
             ertical-align: middle;
             /*appearance:none;*/
             /*-moz-appearance:none;*/
             -webkit-appearance: none;
        }
        input[type=radio]{
             border-radius: 50%;
        }
        input[type=checkbox]:checked:before, input[type=radio]:checked:before {
             float: left;
             color: #fff;
             font-size: 13px;
             display: inline-block;
             vertical-align: middle;
             width: 15px;
             margin-top: 9px;
             margin-left: 1px;
             font-family: "myfont";
             content: "\e6b5";
       }
       input[type=radio]:checked,input[type=checkbox]:checked{
            background-color: #f66;
       }
       </style>
</head>
<body>
       <input type="radio" name="sig" value="" checked>男
       <input type="radio" name="sig" value="" >女<br>
       <input type="checkbox" name="interest" value="" checked>唱歌
       <input type="checkbox" name="interest" value="">乒乓球
       <input type="checkbox" name="interest" value="">篮球
       <input type="checkbox" name="interest" value="" checked>游泳
</body>
</html>

DEMO地址:https://www.asni.cn/demo/demo6/

wechat_app
微信公众号:webapp_club
关注一下,或许能让你获得更多前端咨询信息。
分享中心
各类业务开发,联系QQ:5679361
广告位联系QQ:5679361

评论 抢沙发

评论前必须登录!

 


如果你觉得本站内容对你有所帮助,比如提升你对编程方面的认识,你可以通过上面的二维码请博主喝杯咖啡,安好。

WEB前端开发部落(公众号:webapp_club)

群列表

前端初级学习群:初级Web前端学习群(后期为支付入群)
PHP初级学习群:PHP(MySQL)学习交流群
QQ群仅作为相关领域讨论平台,均提供高质量问题交流,禁止闲聊,无法接受的朋友请勿加群!
进群需要通过这里获取进群码才能进群哦!

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏