Home > Web Front-end > HTML Tutorial > Pure css3 simple and practical checkbox and radio button_html/css_WEB-ITnose

Pure css3 simple and practical checkbox and radio button_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:58:50
Original
932 people have browsed it

Yesterday I shared with you a cool checkbox and radio button. Today I will bring you a simple and practical checkbox and radio button. The interface is clear and comfortable. Let me give you a rendering first:

Online preview Source code download

Implement the html code:

<div class="frame">        <input checked="checked" id="radio_1" name="radio" type="radio">        <label class="radio" for="radio_1">            <i class="fa fa-times"></i>        </label>        <input id="radio_2" name="radio" type="radio">        <label class="radio" for="radio_2">            <i class="fa fa-times"></i>        </label>        <input id="radio_3" name="radio" type="radio">        <label class="radio" for="radio_3">            <i class="fa fa-times"></i>        </label>        <input id="radio_4" name="radio" type="radio">        <label class="radio" for="radio_4">            <i class="fa fa-times"></i>        </label>        <input id="radio_5" name="radio" type="radio">        <label class="radio" for="radio_5">            <i class="fa fa-times"></i>        </label>    </div>    <div class="frame">        <input checked="checked" id="check_1" name="check" type="checkbox">        <label class="check" for="check_1">            <i class="fa fa-check"></i>        </label>        <input id="check_2" name="check" type="checkbox">        <label class="check" for="check_2">            <i class="fa fa-check"></i>        </label>        <input id="check_3" name="check" type="checkbox">        <label class="check" for="check_3">            <i class="fa fa-check"></i>        </label>        <input id="check_4" name="check" type="checkbox">        <label class="check" for="check_4">            <i class="fa fa-check"></i>        </label>        <input id="check_5" name="check" type="checkbox">        <label class="check" for="check_5">            <i class="fa fa-check"></i>        </label>    </div>
Copy after login

css3 code:

      form        {            width: 100vw;            height: 100vh;            display: flex;            flex-flow: column wrap;            justify-content: center;            align-items: center;        }        form .frame        {            display: flex;            flex-flow: row nowrap;        }        form .frame input        {            display: none;        }        form .frame label        {            cursor: pointer;            position: relative;            width: 30px;            height: 30px;            margin: 10px;            background: #8ABA56;            transition: all 0.3s ease-in-out;            font-size: 12pt;            color: #FFF;            -webkit-font-smoothing: antialiased;        }        form .frame label.radio        {            border-radius: 100%;        }        form .frame label.check        {            border-radius: 5px;        }        form .frame label .fa        {            position: absolute;            top: 0;            left: 0;            right: 0;            bottom: 0;            opacity: 0;            -webkit-transform: scale(0);            transition: all 0.3s ease-in-out;            line-height: 30px;            text-align: center;        }        form .frame input:checked + label        {            background: #678b40;        }        form .frame input:checked + label .fa        {            opacity: 1;            -webkit-transform: scale(1);        }
Copy after login

Okay. Copy the above html code and css code. Easily create a beautiful checkbox and radio button

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template