css3 - Hard time to understand :after selector CSS -
according http://www.w3schools.com/cssref/sel_after.asp, after selector includes after each element. understand perfectly. found css-only slider in internet, one: link part of code
.slider label:after { border-radius: 100%; bottom: -.2em; box-shadow: inset 0 0 0 .2em #111, inset 0 2px 2px #000, 0 1px 1px hsla(0,0%,100%,.25); content: ''; left: -.2em; position: absolute; right: -.2em; top: -.2em; }
makes selected picture color radios-circle in white. shouldn't inserted after each label inside .slider ? why aplies selected 1 ?
ofcourse understanding right. specific slider, has below css rules.
.slider input:checked + label { background-color: #fff; }
the above code works like: if input checked, add background color sibling(+) element label
Comments
Post a Comment