checkbox/radio自定義樣式
效果圖:
HTML部分:
<table>
<tr>
<td>
<div class="checkbox-custom">
<input type="checkbox" />
<label></label>
</div>
</td>
<td>
<div class="radio-custom">
<input type="radio" class="radius-50" />
<label></label>
</div>
</td>
</tr>
</table>
CSS部分:
table tr th, table tr td {
border: 1px solid #ccc;
padding: 20px;
}
table {
width: 200px;
text-align: center;
border-collapse: collapse;
}
.checkbox-custom , .radio-custom {
position: relative;
}
.checkbox-custom input[type=checkbox], .radio-custom input[type=radio] {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
-webkit-appearance: none;
background: transparent;
width: 20px;
height: 20px;
border: 1px solid #ccc;
vertical-align: middle;
}
.checkbox-custom .radius-50, .radio-custom .radius-50 {
border-radius: 50%;
}
.checkbox-custom input[type=checkbox]:checked , .radio-custom input[type=radio]:checked {
border-color: #ff6435;
background: #ff6435;
}
.checkbox-custom input[type=checkbox]:checked:after, .radio-custom input[type=radio]:checked:after {
content: '';
position: absolute;
left: 3px;
top: 4px;
width: 10px;
height: 5px;
border-left: 2px solid #fff;
border-bottom: 2px solid #fff;
-webkit-transform: rotateZ(-45deg);
transform: rotateZ(-45deg);
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/200/viewspace-2824123/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Css實現checkbox及radio樣式自定義CSS
- 自定義 checkbox 樣式
- input[type="radio"]自定義樣式
- 自定義checkbox樣式(相容IE9)IE9
- 微信小程式--自定義radio元件樣式微信小程式元件
- elementUI radio修改單選框多選框選中樣式及自定義其他樣式。UI
- 自定義Toast樣式AST
- 總結:如何修改美化radio、checkbox的預設樣式
- IFE糯米學院-checkbox和radio樣式的美化實現
- 如何自定義 drag 樣式
- mui toast自定義樣式UIAST
- 自定義dialog樣式
- Qt Charts 自定義樣式QT
- 自定義 checkbox 新玩法 ?
- css自定義 range radio select的樣式滑輪,按鈕,選擇框CSS
- PHPCMS自定義表單樣式PHP
- android自定義button樣式Android
- Android中自定義CheckboxAndroid
- CefSharp自定義捲軸樣式
- Houdini - 建立自定義的button樣式
- CSS自定義滑鼠指標樣式CSS指標
- ModernUI教程:如何從MUI樣式中派生自定義樣式UI
- pixi.js 自定義游標樣式JS
- jQuery validate 自定義樣式、規則jQuery
- Chrome瀏覽器中checkbox的樣式定義無效Chrome瀏覽器
- checkbox樣式研究——按鈕
- Flex SDK 4(Gumbo)更方便的自定義樣式、自定義SparkSkin(二)薦FlexSpark
- SQLserver自定義樣式主鍵-函式實現篇SQLServer函式
- 「HTML+CSS」--自定義按鈕樣式【004】HTMLCSS
- 「HTML+CSS」--自定義按鈕樣式【003】HTMLCSS
- 自定義Toast樣式+改變Toast寬高AST
- antd-mobile 自定義picker按鈕樣式
- 自定義瀏覽器滾動條樣式瀏覽器
- [HTML/CSS]uploadify自定義按鈕樣式HTMLCSS
- Asp.Net2.0實現自定義樣式ASP.NET
- QFileDialog自定義樣式設定SetStytlesheet
- css的checkbox樣式變化CSS
- jQuery 獲取 radio checkbox 值jQuery