css - Radio buttons to images and hover over values with tooltip -


i trying make selection using images replace radio buttons.

so far, have code works...

<table width="200"> <tr> <td><label> <input type="radio" name="radiogroup1" value="111" id="radiogroup1_0" style="display:none"> <img src="images/addressbook-black-128x128.png" width="128" height="128"> </label></td> </tr> <tr> <td><label> <input type="radio" name="radiogroup1" value="222" id="radiogroup1_1" style="display:none"> <img src="images/addressbook-red-128x128.png" width="128" height="128"></label></td> </tr> </table> 

how add orange border around selected item? , add tooltip in middle of image black square box , words "red books" in white text when selection "hovered" over?

altogether there 16 items, each has different image.

do mean this?

http://jsfiddle.net/coma/zyvz8/16/

html

<div class="options">     <label title="baseball cap">         <input type="radio" name="foo"/>         <img src="http://tshirtbangkok.com/wp-content/uploads/cap-baseball-100x100.jpg"/>     </label> </div> 

css

div.options {     background-color: #fff7c0;     padding: 10px 5px 5px 10px; }  div.options:after {     content: "";     display: block;     clear: both; }  div.options > label {     display: block;     float: left;     margin: 0 5px 5px 0;     overflow: hidden;     cursor: pointer; }  div.options > label > img {     display: block;     border: 2px solid #eee; }  div.options > label > input {     position: absolute;     top: -100px; }  div.options > label > input:checked + img {     border-color: #51a351; } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -