how change checkbox webview android -
how change checkbox webview android -
i have android app load webview. on webview have checkbox don't can alter size.
input[type="checkbox"] { width: 25px; height: 25px; }
screen http://postimg.org/image/l9lg35czj/
change size
input[type="checkbox"] { width: 250px; height: 250px; }
http://postimg.org/image/v96ow0otv/
why size not changed on webview, (if page browser checkbox size changed)?
full code
<html> <head> <style> .single_user { width:100%; height:120px; border: black; background:#e5e5e5; margin-bottom: 10px; } .user_image { padding-left: 10px; padding-top: 10px; } h1 { display: inline-block; } input[type="checkbox"] { width: 25px; height: 25px; } </style> <meta name="viewport" content="width=device-width, target-densitydpi=device-dpi, user-scalable=no"/> </head> <body> <div class="single_user"> <img class="user_image" src="statimg/profileicon.png"/> <h1> vahagn vard2anyan <br /> vvvaagn@gmail.com</h1> <input type="checkbox" style="width: 100%; height:100%;"/> </div> <div class="single_user"> </div> </body> </html>
i faced problem too. checkboxes in html doesn't alter size width/height css properties (but browsers back upwards this). if want alter size, can utilize transform: scale(scalex, scaley);
(see this answer)or can implement custom checkboxes this, trick.
update
checkbox can easy resplaced span text , click event handler
<!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <title></title> <style> #checkbox { width: 30px; height: 30px; background: red; } #checkmark { width: 100%; height: 100%; font-size:30px; position: absolute; } </style> <script type="text/javascript"> function setcheckboxchecked(checkbox) { checkbox.checked = !checkbox.checked; var checkmark = checkbox.queryselector('#checkmark'); if(checkbox.checked) { checkmark.innerhtml = '\u2713'; } else { checkmark.innerhtml = ''; } } </script> </head> <body> <div id="checkbox" onclick="javascript:setcheckboxchecked(this);"> <span id="checkmark"></span> </div> </body> </html>
android checkbox webview
Comments
Post a Comment