"CSS Notes" CSS3 beautify check box

Source: Internet
Author: User

In the past, I saw various examples of CSS3 beautification check boxes on the Internet, which are sorted out today for easy viewing later.

This example involves the binding of input and lable, and the use of opacity (opacity)

First on the effect:


<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>CSS3 Landscaping check box</title>    <styletype= "Text/css">form{Border:1px solid #ccc;padding:20px;width:300px;margin:30px Auto;}. Wrapper{Margin-bottom:10px;}. Box{Display:Inline-block;width:20px;Height:20px;Margin-right:10px;position:relative;Border:2px Solid Green;vertical-align:Middle;}. Box Input{Opacity:0;position:Absolute;Top:0; Left:0;}. Box span{position:Absolute;Top:-10px; Right:3px;font-size:30px;Font-weight:Bold;font-family:Arial;-webkit-transform:Rotate (30deg);Transform:Rotate (30deg);Color:Green;}input[type= "checkbox" + span{Opacity:0;}input[type= "checkbox"]:checked + span{Opacity:1;}    </style></Head><Body>    <formAction="#">  <Divclass= "wrapper">    <Divclass= "box">      <inputtype= "checkbox"checked= "Checked"ID= "Usename" /><span>√</span>    </Div>    <lable for= "Usename">I'm the selected state.</lable>  </Div>    <Divclass= "wrapper">    <Divclass= "box">      <inputtype= "checkbox"ID= "Usepwd" /><span>√</span>    </Div>    <label for= "Usepwd">I'm not selected</label>  </Div></form></Body></HTML>

"CSS Notes" CSS3 beautify check box

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.