input样式美化_input 美化-程序员宅基地

技术标签: css3  

1.checkbox样式优化
效果图如下:
在这里插入图片描述

代码如下:

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>checkbox美化</title>
</head>
<style type="text/css">
    /*input框中颜色更改*/
    .divBox{
        display: flex;
    }
    .iconColor{
        width: 80px;
        height: 80px;
        position: relative;
    }
    #color-input-red+label {
        display: block;
        width: 20px;
        height: 20px;
        cursor: pointer;
        position: absolute;
        border-radius: 4px;
        border:1px solid rgba(240, 84, 77, 1);
        top: 0;
        left: 0;
        background: white;
    }

    #color-input-red:checked+label::before {
        display: block;
        content: "\2714";
        text-align: center;
        font-size: 16px;
        color: rgba(240, 84, 77, 1);
    }

    input[type=checkbox] {
        visibility: hidden;
    }

    #color-input-orange+label {
        display: block;
        width: 20px;
        height: 20px;
        border-radius: 4px;
        cursor: pointer;
        position: absolute;
        top: 0;
        left: 0;
        background: rgba(234, 152, 54, 1);
    }

    #color-input-orange:checked+label::before {
        display: block;
        content: "\2714";
        text-align: center;
        font-size: 16px;
        color: white;
    }

    #color-input-yellow+label {
        display: block;
        width: 20px;
        height: 20px;
        cursor: pointer;
        position: absolute;
        top: 0;
        left: 0;
        background: rgba(230, 192, 58, 1);
    }

    #color-input-yellow:checked+label::before {
        display: block;
        content: "\2714";
        text-align: center;
        font-size: 16px;
        color: white;
    }

    #color-input-green+label {
        display: block;
        width: 20px;
        height: 20px;
        cursor: pointer;
        position: absolute;
        top: 0;
        left: 0;
        background: rgba(95, 189, 65, 1);
    }

    #color-input-green:checked+label::before {
        display: block;
        content: "\2714";
        text-align: center;
        font-size: 16px;
        color: white;
    }

    #color-input-blue+label {
        display: block;
        width: 20px;
        height: 20px;
        cursor: pointer;
        position: absolute;
        top: 0;
        left: 0;
        background: rgba(61, 170, 230, 1);
    }

    #color-input-blue:checked+label::before {
        display: block;
        content: "\2714";
        text-align: center;
        font-size: 16px;
        color: white;
    }

    #color-input-purple+label {
        display: block;
        width: 20px;
        height: 20px;
        cursor: pointer;
        position: absolute;
        top: 0;
        left: 0;
        background: rgba(195, 122, 211, 1);
    }

    #color-input-purple:checked+label::before {
        display: block;
        content: "\2714";
        text-align: center;
        font-size: 16px;
        color: white;
    }
</style>

<body>
    <div class="chat-windows-color-div">
        <div class="divBox">
            <div class="iconColor">
                <input id="color-input-red" class="chat-button-location-radio-input" type="checkbox" name="color-input-red"
                    value="#f0544d" />
                <label for="color-input-red"></label>
            </div>
            <div class="iconColor">
                <input id="color-input-orange" class="chat-button-location-radio-input" type="checkbox" name="color-input-orange"
                    value="#ea9836" />
                <label for="color-input-orange"></label>
            </div>

            <div class="iconColor">
                <input id="color-input-yellow" class="chat-button-location-radio-input" type="checkbox" name="color-input-yellow"
                    value="#e6c03a" />
                <label for="color-input-yellow"></label>
            </div>
            <div class="iconColor">
                <input id="color-input-green" class="chat-button-location-radio-input" type="checkbox" name="color-input-green"
                    value="#5fbd41" />
                <label for="color-input-green"></label>
            </div>
            <div class="iconColor">
                <input id="color-input-blue" class="chat-button-location-radio-input" type="checkbox" name="color-input-blue"
                    value="#3daae6" />
                <label for="color-input-blue"></label>
            </div>
            <div class="iconColor">
                <input id="color-input-purple" class="chat-button-location-radio-input" type="checkbox" name="color-input-purple"
                    value="#c37ad3" />
                <label for="color-input-purple"></label>
            </div>
        </div>
    </div>
</body>

</html>

2.input[type=file] 样式美化
效果图如下:
在这里插入图片描述

代码如下:

<style>
   .a-upload {
    padding: 4px 10px;
    height: 20px;
    line-height: 20px;
    position: relative;
    cursor: pointer;
    color: #888;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    *display: inline;
    *zoom: 1
}

.a-upload  input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
    filter: alpha(opacity=0);
    cursor: pointer
}

.a-upload:hover {
    color: #444;
    background: #eee;
    border-color: #ccc;
    text-decoration: none
}
.file {
    position: relative;
    display: inline-block;
    background: #D0EEFF;
    border: 1px solid #99D3F5;
    border-radius: 4px;
    padding: 4px 12px;
    overflow: hidden;
    color: #1E88C7;
    text-decoration: none;
    text-indent: 0;
    line-height: 20px;
}
.file input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
}
.file:hover {
    background: #AADFFD;
    border-color: #78C3F3;
    color: #004974;
    text-decoration: none;
}
</style>
 <a href="javascript:;" class="a-upload">
       <input type="file" name="" id="">点击这里上传文件
  </a>
            
 <a href="javascript:;" class="file">选择文件
    <input type="file" name="" id="">
 </a>

3.input[type=radio]的样式美化
效果图如下:
在这里插入图片描述
代码如下

<div>
        <p style="font-size:18px;margin-top:30px;color:rgba(0,0,0,0.44)">对吗?</p>
        <label class="demo--label">
            <input class="demo--radio" type="radio" name="demo-radio">
            <span class="demo--radioInput"></span>对
        </label>
        <label class="demo--label">
            <input class="demo--radio" type="radio" name="demo-radio">
            <span class="demo--radioInput"></span>不对
        </label>
    </div>
    <div>
        <p style="font-size:18px;margin-top:30px;color:rgba(0,0,0,0.44)">你喜欢的是?</p>
        <label class="demo--label"><input class="demo--radio" type="checkbox" name="demo-checkbox1">
            <span class="demo--checkbox demo--radioInput"></span>A
        </label>
        <label class="demo--label">
            <input class="demo--radio" type="checkbox" name="demo-checkbox2">
            <span class="demo--checkbox demo--radioInput"></span>B
        </label>
        <label class="demo--label">
            <input class="demo--radio" type="checkbox" name="demo-checkbox3">
            <span class="demo--checkbox demo--radioInput"></span>C
        </label>
    </div>
 <style>
.demo--label{margin:20px 20px 0 0;display:inline-block}
.demo--radio{display:none}
.demo--radioInput{background-color:#fff;border:1px solid rgba(0,0,0,0.15);border-radius:100%;display:inline-block;height:16px;margin-right:10px;margin-top:-1px;vertical-align:middle;width:16px;line-height:1}
.demo--radio:checked + .demo--radioInput:after{background-color:#57ad68;border-radius:100%;content:"";display:inline-block;height:12px;margin:2px;width:12px}
.demo--checkbox.demo--radioInput,.demo--radio:checked + .demo--checkbox.demo--radioInput:after{border-radius:0}
</style>

4.input[type=text]的样式美化
效果图如下:
在这里插入图片描述

代码如下:

<input type="text" class="form_input" placeholder="请输入姓名" />
<style>
        input{

            font-size:12px;
             /* 设置输入框中字体的大小 */

            height:30px; 
            /* 设置输入框的高度 */

            border-radius:4px; 
            /* 设置输入框的圆角的大小 */

            border:1px solid #c8cccf;
            /* 设置输入框边框的粗细和颜色 */

            color:#986655; 
            /* 设置输入框中文字的颜色 */

            outline:0; 
            /* 将输入框点击的时候出现的边框去掉 */

            text-align:left; 
            /* 设置输入框中文字的位置 */

            padding-left: 10px;

            display:block; 
            /* 将输入框设置为块级元素 */

            cursor: pointer;

             box-shadow: 2px 2px 5px 1px #ccc;  

            }

         input::-webkit-input-placeholder{
             color: #986655;
             font-size: 12px;
         }


  </style>
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_25462315/article/details/85233760

智能推荐

机器学习算法学习02:决策树的学习以及应用决策树解决Cora数据集论文分类问题_传统机器学习解决cora数据集论文分类问题-程序员宅基地

文章浏览阅读1.1k次,点赞3次,收藏7次。机器学习03:决策树的学习以及应用决策树解决Cora数据集论文分类问题文章目录机器学习03:决策树的学习以及应用决策树解决Cora数据集论文分类问题1.前言2.算法分析2.1算法概述2.2 算法优化3.算法代码3.1 决策属性优先级选择3.1.1 信息熵3.2.2 信息增益率3.3.3 基尼系数3.2 数据集的预处理3.3 决策树的生成3.4 决策树的分类4.算法运行与评估4.1 使用信息增益来划分数据集4.2 使用信息增益率划分数据4.3 使用基尼指数划分数据5.结语1.前言决策树方法作为非常经典的_传统机器学习解决cora数据集论文分类问题

NVIDIA控制面板不见了解决方法-程序员宅基地

文章浏览阅读4.4k次,点赞2次,收藏2次。NVIDIA控制面板调不出来欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。新的改变我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功能,我们增加了如下几点新功能,帮助你用它写博客:全新的界面设计 ,将会带来全新的写作体验;在创作中心设置你喜爱的代码高亮样式,Markdown 将代码片显示选择的高亮

x4412开发板&ibox卡片电脑项目实战16-将hello x4412驱动编译成模块-程序员宅基地

文章浏览阅读1.3k次。在内核根目录执行make menuconfig,进入Device Drivers-> Character devices菜单界面,找到hello X4412 driver配置选项,按空格键将它配置成模块[M],保存退出。执行如下指令,保存配置好的内核配置文件:cp .config arch/arm/configs/x4412_android_defconfig 再在整个源码

新一代大数据引擎操作系统:DataWorks V2.0重磅来袭-程序员宅基地

文章浏览阅读723次。摘要: 众所周知,MaxComput与Blink分别是阿里巴巴自主研发的离线计算、实时计算大数据计算引擎,不仅拥有多项国家专利技术,而且多项关键指标已远超业内开源引擎平均能力,名副其实地成为了阿里巴巴大数据之路上的领航者。认识DataWorks:新一代大数据引擎操作系统众所周知,MaxComput与Blink分别是阿里巴巴自主研发的离线计算、实时计算大数据计算引擎,不仅拥有多项国家专利技术...

不好好作图的NCS系列(五):从这篇Cell学习GSEA的R语言分析及作图-程序员宅基地

文章浏览阅读3.6k次,点赞10次,收藏30次。之前我们在讲转录组系列的时候,说过差异基因的功能富集,用的是GO和KEGG分析。但是这远远不够,很多研究者更喜欢使用GSEA,全名是Gene Set Enrichment Analysis (基因集富集分析)。GSEA在一定程度上与GO一样,但是两者具有巨大的差别。GO使用的是差异基因,因为阈值的设定是人为的,所以很有可能遗漏一些重要基因,仅仅是因为这些基因的变化较小。而GSEA则不同,它需要的是对所有的基因进行分析,因此能够保留更多的信息。通俗的说,GSEA的适用场景是:在两种不同的生物学状态下,

Odoo2021最新实用教程之——Odoo Studio 在线开发工具实战入门指导-程序员宅基地

文章浏览阅读4.7k次。Odoo Studio 作为Odoo企业版中的核心模块,能让odoo使用者通过此设计器快速、高效地构建新模块以及方便地进行已有功能地调整。但目前缺乏与Odoo Studio有关的中文指导资料,本文通过文字与视频结合的方式讲解Odoo Studio的实战操作,希望帮助有需要的朋友快速掌握这个工具。即使你最终可能不用企业版,但通过odoo企业版在线试用提供的这个在线开发工具也能帮助你对odoo的原理更快的了解。 Odoo的在线开发工具是Odoo企业版提供的强力设计工具,本实战..._odoo studio

随便推点

【问题】解决docker 容器中文乱码_主机内的vi支持中文,但是docker内vi不支持中文-程序员宅基地

文章浏览阅读3.5k次。进入容器 查看字符集# docker exec -it <container_id> /bin/bash# locale 查看当前容器字符集# locale -a 查看容器支持的字符集从输出可以看到,系统使用的是POSIX字符集,POSIX字符集是不支持中文的,而UTF-8是支持中文的 只要把系统中的环境 LANG 改为”UTF-8”格式即可解决问题。临时设置#vi /etc/profile 进入文件加入变量# export LANG="en_US..._主机内的vi支持中文,但是docker内vi不支持中文

已知数据信息为 16位,最少应附加( )位校验位,以实现海明码纠错。_已知数据信息为16位,最少应附加-程序员宅基地

文章浏览阅读582次。已知数据信息为 16位,最少应附加( )位校验位,以实现海明码纠错。 A、3B、4C、5D、6答案:C答案解析:根据公式 2的k次方 ≥ n+k+1 , n=16 则 K=5_已知数据信息为16位,最少应附加

VUE项目报错webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 192.168.1.10-程序员宅基地

文章浏览阅读1.1k次。首先粘上logF:\BackStage>npm run dev> [email protected] dev F:\BackStage> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 192.168.1.105报这个错我也是很无奈,正常情况下VU...

【ElasticSearch】RestClient和ElasticsearchTemplate实现高亮查询-程序员宅基地

文章浏览阅读1.9k次。在查询的时候希望,查询结果中的包含查询关键字高亮。(Es版本,6.5.4)前提准备,首先建立mappingPOST http://47.101.167.46:9200/hello_es/doc/_mapping{ "properties": { "name": { "type": "text", "analyzer":"ik_max_word", ...

PDF转word_pdf转word的方式csdn-程序员宅基地

文章浏览阅读2.4k次,点赞3次,收藏3次。https://www.addpdf.cn/pdf-to-word_pdf转word的方式csdn

背包问题 ——第K优解 或 次优解_次优解符号-程序员宅基地

文章浏览阅读1.9k次。附上水题一枚:http://acm.hdu.edu.cn/showproblem.php?pid=2639_次优解符号

推荐文章

热门文章

相关标签