日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

html滚动选择框代码,如何使用最简单纯Css代码美化checkbox复选框、radios单选框和滑动按钮...

發(fā)布時(shí)間:2025/3/17 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html滚动选择框代码,如何使用最简单纯Css代码美化checkbox复选框、radios单选框和滑动按钮... 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

最簡(jiǎn)潔的代碼美化復(fù)選框、單選框和滑動(dòng)按鈕

效果預(yù)覽

1. 復(fù)選框

.switch {

margin: 20px 20px 0 0;

display: flex;

align-items: center;

width: auto;

}

.checkbox-input {

display: none

}

.checkbox {

-webkit-transition: background-color 0.3s;

transition: background-color 0.3s;

background-color: #fff;

border: 1px solid #d7d7d7;

border-radius: 3px;

width: 16px;

height: 16px;

vertical-align:middle;

margin: 0 5px;

}

.checkbox-input:checked+.checkbox {

background-color: #57ad68;

}

.checkbox-input:checked+.checkbox:after {

content: "\2714";

display: inline-block;

height: 100%;

width: 100%;

color: #fff;

text-align: center;

line-height: 16px;

font-size: 12px;

box-shadow: 0 0 4px #57ad68;

}

Hello

2. 單選框

.switch {

display: flex;

align-items: center;

width: auto;

float: left;

}

.radio-beauty-container .radio-beauty {

width: 16px;

height: 16px;

box-sizing: border-box;

display: inline-block;

border: 1px solid #d7d7d7;

margin: 0 5px;

border-radius: 50%;

transition: 0.2s;

}

.radio-beauty-container input[type="radio"]:checked+.radio-beauty {

border: solid 1px green;

padding: 3px;

background-color: green;

background-clip: content-box;

box-shadow: inset 0 0 1px rgba(0,128,0, 0.2), 0 0 3px green;

}

radio2

radio3

3. 滑動(dòng)按鈕

.switch-slide-label {

display: block;

width: 34px;

height: 18px;

background: #ccc;

border-radius: 30px;

cursor: pointer;

position: relative;

-webkit-transition: 0.3s ease;

transition: 0.3s ease;

}

.switch-slide-label:after {

content: '';

display: block;

width: 16px;

height: 16px;

border-radius: 100%;

background: #fff;

box-shadow: 0 1px 1px rgba(0, 0, 0, .1);

position: absolute;

left: 1px;

top: 1px;

-webkit-transform: translateZ(0);

transform: translateZ(0);

-webkit-transition:0.3s ease;

transition:0.3s ease;

}

.switch-slide input:checked+label {

background: #34bf49;

transition: 0.3s ease;

}

.switch-slide input:checked+label:after {

left: 17px;

}

總結(jié)

以上是生活随笔為你收集整理的html滚动选择框代码,如何使用最简单纯Css代码美化checkbox复选框、radios单选框和滑动按钮...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。