How does CSS Customize the radio radio box style? (Code implementation)

Source: Internet
Author: User
What this article brings to you is about how CSS customizes radio radio box style? (Code implementation), there is a certain reference value, the need for friends can refer to, I hope to help you.

HTML section

<div class= "Radio" >    <label>        <input name= "Feel" type= "Radio" value= "Love"/>        <span class= "pos" >            <span class= "RADIO_BG" >                <span class= "radio_on" ></span>            </span >        </span>        <span>LOVE</span>    </label>    <label>        <input Name= "Feel" type= "Radio" value= "hate"/>        <span class= "pos" >            <span class= "RADIO_BG" >                <span class= "radio_on" ></span>            </span>        </span>        <span>you is nice </span>    </label></div>

CSS Styles Section

            . radio {width:260px;                height:26px;                line-height:26px;                margin:200px Auto;                Background-color: #ddeef1;                font-size:16px;                Color: #495060;            Text-align:center;            } label:first-child {margin-right:40px;            } label input,. radio_on {display:none;                }. pos {display:inline;            Vertical-align:middle;              }. radio_bg {position:relative;              Display:inline-block;              height:14px;              width:14px;              border:1px solid #B3B4B8;            border-radius:50%; } label:hover. RADIO_BG, label input:checked + span.pos SPAN.RADIO_BG {border:1px solid            #27B28B; } Label input:checked + Span.pos span.radio_bg. radio_on {display:inline-block;              Position:absolute;              top:2px;              left:2px;              width:10px;              height:10px;              border-radius:50%;            Background-color: #27B28B; }

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.