純css3實現的超炫checkbox複選框和radio單選框,css3checkbox

來源:互聯網
上載者:User

純css3實現的超炫checkbox複選框和radio單選框,css3checkbox

之前為大家分享了好多css3實現的按鈕。今天要為大家分享的是純css3實現的checkbox複選框和radio單選框,效果超級炫。先讓我們看看圖吧!

 

線上預覽   源碼下載

 

這個執行個體完全由css3實現的沒有任何js代碼。下面我們一起看下實現代碼吧

html代碼:

 <div style="width:200px; float:left">            <label>                <input type="checkbox" class="option-input checkbox" checked="">                Checkbox            </label>            <label>                <input type="checkbox" class="option-input checkbox">                Checkbox            </label>            <label>                <input type="checkbox" class="option-input checkbox">                Checkbox            </label>        </div>        <div style="width:200px; float:left">            <label>                <input type="radio" class="option-input radio" name="example">                Radio option            </label>            <label>                <input type="radio" class="option-input radio" name="example">                Radio option            </label>            <label>                <input type="radio" class="option-input radio" name="example">                Radio option            </label>        </div>

css3代碼:

@-webkit-keyframes click-wave {  0% {    width: 40px;    height: 40px;    opacity: 0.35;    position: relative;  }  100% {    width: 200px;    height: 200px;    margin-left: -80px;    margin-top: -80px;    opacity: 0.0;  }}@-moz-keyframes click-wave {  0% {    width: 40px;    height: 40px;    opacity: 0.35;    position: relative;  }  100% {    width: 200px;    height: 200px;    margin-left: -80px;    margin-top: -80px;    opacity: 0.0;  }}@-o-keyframes click-wave {  0% {    width: 40px;    height: 40px;    opacity: 0.35;    position: relative;  }  100% {    width: 200px;    height: 200px;    margin-left: -80px;    margin-top: -80px;    opacity: 0.0;  }}@keyframes click-wave {  0% {    width: 40px;    height: 40px;    opacity: 0.35;    position: relative;  }  100% {    width: 200px;    height: 200px;    margin-left: -80px;    margin-top: -80px;    opacity: 0.0;  }}.option-input {  -webkit-appearance: none;  -moz-appearance: none;  -ms-appearance: none;  -o-appearance: none;  appearance: none;  position: relative;  top: 13.33333px;  width: 40px;  height: 40px;  -webkit-transition: all 0.15s ease-out 0;  -moz-transition: all 0.15s ease-out 0;  transition: all 0.15s ease-out 0;  background: #cbd1d8;  border: none;  color: #fff;  cursor: pointer;  display: inline-block;  outline: none;  position: relative;  margin-right: 0.5rem;  z-index: 1000;}.option-input:hover {  background: #9faab7;}.option-input:checked {  background: #40e0d0;}.option-input:checked::before {  width: 40px;  height: 40px;  position: absolute;  content: '\2716';  display: inline-block;  font-size: 26.66667px;  text-align: center;  line-height: 40px;}.option-input:checked::after {  -webkit-animation: click-wave 0.65s;  -moz-animation: click-wave 0.65s;  animation: click-wave 0.65s;  background: #40e0d0;  content: '';  display: block;  position: relative;  z-index: 100;}.option-input.radio {  border-radius: 50%;}.option-input.radio::after {  border-radius: 50%;}body {  display: -webkit-box;  display: -moz-box;  display: box;  -webkit-box-orient: horizontal;  -moz-box-orient: horizontal;  box-orient: horizontal;  -webkit-box-pack: start;  -moz-box-pack: start;  box-pack: start;  -webkit-box-align: stretch;  -moz-box-align: stretch;  box-align: stretch;  background: #e8ebee;  color: #9faab7;  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;  text-align: center;}body div {  padding: 5rem;}body label {  display: block;  line-height: 40px;}

是不是很簡單。只要複製上面的html代碼和css代碼到頁面上。運行就可以看到效果了。趕緊試一試吧。哈哈

註:本文愛編程原創文章,轉載請註明原文地址:http://www.w2bc.com/Article/5384


php,怎用ajax實現將用戶端的單選框radio或複選框的選擇結果,提交到服務端存到session數組中?

用戶端提交後,在PHP裡面是在$_POST或者$_GET裡面,你根據需要儲存到session裡面即可,具體語句於你form裡面的變數有關,例如:

<form method=post>
<select name=chechbox1><option>xxx<option>yyy</select>
</form>

那麼,提交後在PHP裡面是儲存在$_POST裡面的,變數為$_POST['checkbox1'],要儲存到會話裡面,可以這樣:

$SESSION['form_checkbox1']=$_POST['checkbox1'];

變數名都是由你喜歡取的。
 
aspnet中單選框<asp:RadioButton />與複選框<asp:CheckBox />垂直置中對齊的方法

<td class="td1" align="center" style="text-align: left;" valign="middle">
<asp:RadioButtonList ID="RadSelfAppraise" runat="server" RepeatDirection="Vertical"
CellPadding="2" CellSpacing="2"
AutoPostBack="true">
<asp:ListItem Value="5" Text="5"></asp:ListItem>
<asp:ListItem Value="4" Text="4"></asp:ListItem>
<asp:ListItem Value="3" Text="3"></asp:ListItem>
<asp:ListItem Value="2" Text="2"></asp:ListItem>
<asp:ListItem Value="1" Text="1"></asp:ListItem>
<asp:ListItem Value="0&quot......餘下全文>>
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.