纯css3简单实用的checkbox复选框和radio单选框_html/css_WEB-ITnose
昨天为大家分享了一款很炫的checkbox复选框和radio单选框,今天再给大家带来一款简单实用的checkbox复选框和radio单选框。界面清淅、舒服。先给大家来张效果图:
在线预览 源码下载
实现html代码:
<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>
css3代码:
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); }
好了。复制上面的html代码和css代码。轻松搞定一款漂亮的checkbox、radio按钮

熱AI工具

Undress AI Tool
免費脫衣圖片

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

純CSS3怎麼實現波浪效果?這篇文章就來跟大家介紹一下使用 SVG 和 CSS 動畫來製作波浪效果的方法,希望對大家有幫助!

PyCharm新手指南:刪除專案的實用技巧PyCharm是一款功能強大的Python整合開發環境(IDE),在進行專案開發時,有時候需要刪除專案或專案中的檔案。本文將介紹在PyCharm中刪除專案的實用技巧,並提供具體的程式碼範例幫助新手更好地理解和應用。 1.刪除項目刪除項目意味著刪除整個項目資料夾,這在我們需要清理或重建項目時非常有用。在PyCharm中刪

全角英文字母轉換為半角形式的實用技巧在現代生活中,我們經常會接觸到英文字母,在使用電腦、手機等設備時也經常需要輸入英文字母。然而,有時候我們會遇到全角英文字母的情況,而我們需要使用的是半角形式。那麼,如何將全角英文字母轉換為半角形式呢?以下就為大家介紹一些實用的技巧。首先,全角英文字母和數字是指在輸入法中佔據一個全角位置的字符,而半角英文字母和數字則是佔據一

兩種方法:1、利用display屬性,只要為元素加上「display:none;」樣式即可。 2.利用position和top屬性設定元素絕對定位來隱藏元素,只需為元素加上「position:absolute;top:-9999px;」樣式。

實作方法:1、使用「:active」選擇器選取滑鼠點擊圖片的狀態;2、使用transform屬性和scale()函數實現圖片放大效果,語法「img:active {transform: scale(x軸放大倍率,y軸放大倍率);}」。

怎麼製作文字輪播與圖片輪播?大家第一想到的是利用js,其實利用純CSS也能實現文字輪播與圖片輪播,下面來看看實作方法,希望對大家有幫助!

在css中,可以利用border-image屬性來實作花邊邊框。 border-image屬性可以使用圖片來建立邊框,即給邊框加上背景圖片,只需要將背景圖片指定為花邊樣式即可;語法「border-image: url(圖片路徑) 向內偏移值圖像邊界寬度outset 是否重複;」。
