javascript - Changing style of input without display:none -



javascript - Changing style of input without display:none -

a mutual way replace standard input display:none input, , add together background-image label.

css:

class="lang-css prettyprint-override">input[type="checkbox"] { display: none; } input[type="checkbox"]+label { background: url('../images/checkbox_unchecked.png') left center no-repeat; background-size: 25px; } input[type="checkbox"]:checked+label { background: url('../images/checkbox_checked.png') left center no-repeat; background-size: 25px; }

the problem: html broken afterwards. when want alter direction of elements, have alter within css (background: right).

how can alter image/style of input field without create display:none first, , alter background image? has work in android 2.3.

edit: jsfiddle.

the simple prepare rtl issue (assuming main problem here, based on jsfiddle demo), style on dir attribute when set "rtl":

class="lang-css prettyprint-override">.styles[dir="rtl"] input[type="radio"]+label { background-position: right; /* set background position right. */ padding-left: 0; /* reset left padding on label. */ padding-right: 35px; /* give label right padding. */ }

jsfiddle demo.

everything i've used above should work on android 2.3 according can use....

javascript html css

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -