使用 css 样式输入收音机 [英] Styling input radio with css
本文介绍了使用 css 样式输入收音机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个带有 [input type="radio"]
的幻灯片:
CSS
#slideselector {位置:绝对;顶部:0;左:0;边框:2px纯黑色;填充顶部:1px;}.slidebutton {高度:21px;边距:2px;}#幻灯片{边距:50px 自动;位置:相对;宽度:240px;高度:240px;填充:10px;box-shadow: 0 0 20px rgba(0,0,0,0.4);}#幻灯片 >div {位置:绝对;顶部:10px;左:10px;右:10px;底部:10px;溢出:隐藏;}.imgLike {宽度:100%;高度:100%;}/* 收音机 */输入[类型=收音机"] {背景颜色:#ddd;背景图像:-webkit-linear-gradient(0deg, 透明 20%, hsla(0,0%,100%,.7), 透明 80%),-webkit-linear-gradient(90deg, 透明 20%, hsla(0,0%,100%,.7), 透明 80%);边框半径:10px;box-shadow: inset 0 1px 1px hsla(0,0%,100%,.8),0 0 0 1px hsla(0,0%,0%,.6),0 2px 3px hsla(0,0%,0%,.6),0 4px 3px hsla(0,0%,0%,.4),0 6px 6px hsla(0,0%,0%,.2),0 10px 6px hsla(0,0%,0%,.2);光标:指针;显示:内联块;高度:15px;右边距:15px;位置:相对;宽度:15px;-webkit 外观:无;}输入 [type="radio"]:after {背景色:#444;边框半径:25px;box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.4),0 1px 1px hsla(0,0%,100%,.8);内容: '';显示:块;高度:7px;左:4px;位置:相对;顶部:4px;宽度:7px;}输入 [type="radio"]:checked:after {背景色:#f66;box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.4),插入 0 2px 2px hsla(0,0%,100%,.4),0 1px 1px hsla(0,0%,100%,.8),0 0 2px 2px hsla(0,70%,70%,.4);}
I have this slideshow with [input type="radio"]
: http://jsfiddle.net/Jtec5/23/
Codes: CSS:
#slideselector {
position: absolue;
top:0;
left:0;
border: 2px solid black;
padding-top: 1px;
}
.slidebutton {
height: 21px;
margin: 2px;
}
I'm trying to style the input radio with css so it looks like that: any suggestions?
解决方案
Like this
CSS
#slideselector {
position: absolue;
top:0;
left:0;
border: 2px solid black;
padding-top: 1px;
}
.slidebutton {
height: 21px;
margin: 2px;
}
#slideshow {
margin: 50px auto;
position: relative;
width: 240px;
height: 240px;
padding: 10px;
box-shadow: 0 0 20px rgba(0,0,0,0.4);
}
#slideshow > div {
position: absolute;
top: 10px;
left: 10px;
right: 10px;
bottom: 10px;
overflow:hidden;
}
.imgLike {
width:100%;
height:100%;
}
/* Radio */
input[type="radio"] {
background-color: #ddd;
background-image: -webkit-linear-gradient(0deg, transparent 20%, hsla(0,0%,100%,.7), transparent 80%),
-webkit-linear-gradient(90deg, transparent 20%, hsla(0,0%,100%,.7), transparent 80%);
border-radius: 10px;
box-shadow: inset 0 1px 1px hsla(0,0%,100%,.8),
0 0 0 1px hsla(0,0%,0%,.6),
0 2px 3px hsla(0,0%,0%,.6),
0 4px 3px hsla(0,0%,0%,.4),
0 6px 6px hsla(0,0%,0%,.2),
0 10px 6px hsla(0,0%,0%,.2);
cursor: pointer;
display: inline-block;
height: 15px;
margin-right: 15px;
position: relative;
width: 15px;
-webkit-appearance: none;
}
input[type="radio"]:after {
background-color: #444;
border-radius: 25px;
box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.4),
0 1px 1px hsla(0,0%,100%,.8);
content: '';
display: block;
height: 7px;
left: 4px;
position: relative;
top: 4px;
width: 7px;
}
input[type="radio"]:checked:after {
background-color: #f66;
box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.4),
inset 0 2px 2px hsla(0,0%,100%,.4),
0 1px 1px hsla(0,0%,100%,.8),
0 0 2px 2px hsla(0,70%,70%,.4);
}
这篇关于使用 css 样式输入收音机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文