下拉框 <select>
        
          默认样式
          长度为200px,高度为34px
          
            
          
          
            
              - <select class="xselect">
 
              - <option>选项1</option>
 
              - <option>选项2</option>
 
              - <option>选项3</option>
 
              - </select>
 
            
            
            
              
              
              
            
           
         
        
          圆角样式
          border-radius为5px
          
            
          
          
            
              - <select class="xselect xround">
 
              - <option>选项1</option>
 
              - <option>选项2</option>
 
              - <option>选项3</option>
 
              - </select>
 
            
            
            
              
              
              
            
           
         
        
          黑色样式
          border-radius为5px
          
            
          
          
            
              - <select class="xselect xblack">
 
              - <option>选项1</option>
 
              - <option>选项2</option>
 
              - <option>选项3</option>
 
              - </select>
 
            
            
            
              
              
              
            
           
         
        
          宽度
          xwidth1长度为250px,每次增加50px
          
            
            
            
            
            
            
          
          
            
              - <select class="xselect xwidth1">
 
              - <option>选项1</option>
 
              - <option>选项2</option>
 
              - <option>选项3</option>
 
              - </select>
 
            
            
            
              
              
              
            
           
         
        
          高度
          xheight1高度为38px,每次增加4px
          
            
            
            
            
          
          
            
              - <select class="xselect xheight1">
 
              - <option>选项1</option>
 
              - <option>选项2</option>
 
              - <option>选项3</option>
 
            
            
            
              
              
              
            
           
         
        
          100%宽度
          长度为100%
          
            
          
          
            
              - <select class="xselect xful">
 
              - <option>选项1</option>
 
              - <option>选项2</option>
 
              - <option>选项3</option>
 
              - </select>
 
            
            
            
              
              
              
            
           
         
        
          组合样式
          可多个样式随意组合
          
            
          
          
            
              - <select class="xselect xful xround">
 
              - <option>选项1</option>
 
              - <option>选项2</option>
 
              - <option>选项3</option>
 
              - </select>
 
            
            
            
              
              
              
            
           
         
       
      
      
        复选框 <input type="checkbox">
        
        
          
            
              | 颜色表 | 
              描述 | 
              class | 
            
            
              | 蓝色 | 
              xblue xblue2 | 
            
            
              | 红色 | 
              xred xred2 | 
            
            
              | 黄色 | 
              xyellow xyellow2 | 
            
            
              | 绿色 | 
              xgreen xgreen2 | 
            
            
              | 黑色 | 
              xblack xblack2 | 
            
            
              | 颜色后面加 2 时,表示选中后文字一起变色,具体见下方例示代码 | 
            
          
         
        
        
        
        
        
          纵向显示
          
          
            
              - <div class="xcheckbox">
 
              - <label>
 
              - <input type="checkbox" name="checkbox1[]" /><em></em>
 
              - <span>菠萝</span>
 
              - </label>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
       
      
      
        开关 <input type="checkbox">
        本质上是单个的复选框
        
        
        
        
        
        
        
        
          其他颜色
          class="xswitch",为 <input> 额外添加一个颜色CSS即可
          class="xswitch-tip",为 <input> 父标签额外添加一个颜色CSS即可
          
          
            
              - <input class="xswitch xblue" type="checkbox" />
 
              
              - /****或****/
 
              
              - <div class="xswitch-tip xblue">
 
              - <label>
 
              - <input type="checkbox" name="checkbox1" /><em></em>
 
              - <span>是否发射核弹</span>
 
              - <span>发射!!</span>
 
              - </label>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
       
      
      
        上传控件 <input type="file">
        class="xfile",为 <input> 父标签内的上传控件增加默认样式
        
          默认样式
          
          
            
              - <div class="xfile">
 
              - <input type="file" />
 
              - <span><i></i>默认样式</span>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        class="xfile xlit",为 <input> 父标签内的上传控件增加小尺寸样式
        
        
        
        
          无图标样式
          
          
            
              - <div class="xfile">
 
              - <input type="file" />
 
              - <span>无图片样式</span>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          自定义图片样式<img>
          图片无尺寸要求
          
          
            
              - <div class="xfile">
 
              - <input type="file" />
 
              - <span><img src="css/img.png" />自定义图片样式</span>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          自定义font样式<i class="icon-【自定义font class名】">
          当<i>标签class包含icon- ico- ion- glyphicon- fa- ti- zmdi- wi-(常用图标库)时,默认图标会被替换成新的font图标
          
          
            
              - <div class="xfile">
 
              - <input type="file" />
 
              - <span><i class="icon-"></i>自定义font样式</span>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
          选中文件反馈
          由于css不支持检测是否有选中文件,所以选中反馈需要添加额外的 javascript 代码,这是本项目唯一有用到 javascript 的地方
          当然这不是必要的,你可以选择不加,只是用户体验不好,用户不知道有没有选中文件
          本例使用了原生的 javascript 代码,无需加载 jQuery
          
          
            
              - <div class="xfile">
 
              - <input type="file" onchange="xfileok(this)" />
 
              - <span><i></i>未选中文件</span>
 
              - </div>
 
               
              - <script>
 
              - function xfileok(o)
 
              - {
 
              - //获取文件名
 
              - let files = o.files;
 
              - let fval;
 
              - if(files.length>1){
 
              - fval = files.length+"个文件";
 
              - }else if(files.length==1){
 
              - fval = files[0].name;
 
              - }
 
               
              - //修改文本
 
              - let prefix = '已选择: ';
 
              - let reg = /(\<i(\s{1,}class\=[\"\'][A-z0-9_\-]*[\"\'])?\>\<\/i\>|\<img\s{1,}src\=[\"\'][A-z0-9_\/\.\-]*[\"\']\s{0,}\/{0,}\>)?(\S*)/;
 
              - let span = o.parentNode.getElementsByTagName("span")[0];
 
              - spanhtml = span.innerHTML;
 
              - match = spanhtml.match(reg);
 
              - oldname = span.dataset.oldname;
 
               
              - html = '';
 
              - if(match[1]){
 
              - html += match[1];
 
              - }
 
              - if(fval){
 
              - html += prefix + fval;
 
              - span.innerHTML = html;
 
              - if(!oldname){
 
              - span.dataset.oldname = match[3];
 
              - }
 
              - }else{
 
              - html += oldname;
 
              - span.innerHTML = html;
 
              - }
 
              - }
 
              - </script>
 
            
            
            
              
              
              
            
           
         
       
      
      
        表格 <table>
        
          
            
              | 标签 | 
              class="" | 
              描述 | 
            
            
              | <table> | 
              <table class="xtable">…</table> | 
              表格本身 | 
            
            
              | <table>的父标签 | 
              <div class="xtablein"><table>…</table></div> | 
              元素内的表格 | 
            
          
         
        
        
          默认样式:少量的内边距(padding:8px)和边框
          class="xtable",为 <table> 标签增加默认样式
          class="xtablein",为 <table> 父标签内的表格增加默认样式
          
            
              
                | A | 
                B | 
                C | 
              
              
                | 1 | 
                a | 
                b | 
                c | 
              
              
                | d | 
                e | 
                f | 
              
              
                | 2 | 
                g | 
                h | 
              
              
                | 3 | 
                i | 
                j | 
              
            
           
          
            
              - <table class="xtable">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          无外部边框样式
          class="xtable xnobor-out",为 <table> 标签增加无外部边框样式
          class="xtablein xnobor-out",为 <table> 父标签内的表格增加无外部边框样式
          
            
              
                | A | 
                B | 
                C | 
              
              
                | 1 | 
                a | 
                b | 
                c | 
              
              
                | d | 
                e | 
                f | 
              
              
                | 2 | 
                g | 
                h | 
              
              
                | 3 | 
                i | 
                j | 
              
            
           
          
            
              - <table class="xtable xnobor-out">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xnobor-out">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          无内部边框样式
          class="xtable xnobor-in",为 <table> 标签增加无内部边框样式
          class="xtablein xnobor-in",为 <table> 父标签内的表格增加无内部边框样式
          
          
            
              - <table class="xtable xnobor-in">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xnobor-in">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          无全部边框样式
          class="xtable xnobor-all",为 <table> 标签增加无全部边框样式
          class="xtablein xnobor-all",为 <table> 父标签内的表格增加无全部边框样式
          
          
            
              - <table class="xtable xnobor-all">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xnobor-all">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          水平边框样式
          class="xtable xbor-tr",为 <table> 标签增加水平边框样式
          class="xtablein xbor-tr",为 <table> 父标签内的表格增加水平边框样式
          
            
              
                | A | 
                B | 
                C | 
              
              
                | 1 | 
                a | 
                b | 
                c | 
              
              
                | d | 
                e | 
                f | 
              
              
                | 2 | 
                g | 
                h | 
              
              
                | 3 | 
                i | 
                j | 
              
            
           
          
            
              - <table class="xtable xbor-tr">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xbor-tr">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          水平边框无外边框样式
          class="xtable xbor-tr-noout",为 <table> 标签增加水平边框无外边框样式
          class="xtablein xbor-tr-noout",为 <table> 父标签内的表格增加水平边框无外边框样式
          
            
              
                | A | 
                B | 
                C | 
              
              
                | 1 | 
                a | 
                b | 
                c | 
              
              
                | d | 
                e | 
                f | 
              
              
                | 2 | 
                g | 
                h | 
              
              
                | 3 | 
                i | 
                j | 
              
            
           
          
            
              - <table class="xtable xbor-tr-noout">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xbor-tr-noout">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          圆角样式
          class="xtable xround",为 <table> 标签增加圆角样式
          class="xtablein xround",为 <table> 父标签内的表格增加圆角样式
          
            
              
                | 1 | 
                First Name | 
                Last Name | 
                Username | 
              
              
                | 1 | 
                Mark | 
                Otto | 
                @mdo | 
              
              
                | Mark | 
                Otto | 
                @TwBootstrap | 
              
              
                | 2 | 
                Jacob | 
                Thornton | 
                @fat | 
              
              
                | 3 | 
                Larry the Bird | 
                @twitter | 
              
            
           
          
            
              - <table class="xtable xround">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xround">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          行间隔背景色 奇数(xodd) 或 偶数(xeven)
          class="xtable xodd / xeven",为 <table> 标签增加行间隔背景色
          class="xtablein xodd / xeven",为 <table> 父标签内的表格增加行间隔背景色
          
            
              
                | # | 
                First Name | 
                Last Name | 
                Username | 
              
              
                | 1 | 
                Mark | 
                Otto | 
                @mdo | 
              
              
                | 2 | 
                Mark | 
                Otto | 
                @TwBootstrap | 
              
              
                | 3 | 
                Jacob | 
                Thornton | 
                @fat | 
              
            
            
            
              
                | # | 
                First Name | 
                Last Name | 
                Username | 
              
              
                | 1 | 
                Mark | 
                Otto | 
                @mdo | 
              
              
                | 2 | 
                Mark | 
                Otto | 
                @TwBootstrap | 
              
              
                | 3 | 
                Jacob | 
                Thornton | 
                @fat | 
              
            
           
          
            
              - <table class="xtable xodd">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xodd">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
              
              - /****************或****************/
 
              
              - <table class="xtable xeven">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xeven">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>
 
            
            
            
              
              
              
            
           
         
        
        
          鼠标悬停样式
          class="xtable xhover",为 <table> 标签增加鼠标悬停样式
          class="xtable xhover",为 <table> 父标签内的表格增加鼠标悬停样式
          
            
              
                | # | 
                First Name | 
                Last Name | 
                Username | 
              
              
                | 1 | 
                Mark | 
                Otto | 
                @mdo | 
              
              
                | 2 | 
                Mark | 
                Otto | 
                @TwBootstrap | 
              
              
                | 3 | 
                Jacob | 
                Thornton | 
                @fat | 
              
            
           
          
            
              - <table class="xtable xhover">
 
              - …
 
              - </table>
 
              
              - /****或****/
 
              
              - <div class="xtablein xhover">
 
              - <table>
 
              - …
 
              - </table>
 
              - </div>