CSS: Wrap div exactly around checkbox

melcvjpatric

New Member
I would like to fit a div exactly around a checkbox. I am doing this because I want to use it to set a background color of the checkbox.I've tried this, but the pink div sticks out below the checkbox. jsFiddle\[code\]#checkbox{ margin:0px; padding:0px; opacity:0.5;}#checkbox_wrapper{ background:pink; float:left;}<div id = "checkbox_wrapper" > <input type="checkbox" id = "checkbox"/></div>\[/code\]
 
Back
Top