Use images instead of radio buttons

后端 未结 8 1796
Happy的楠姐
Happy的楠姐 2020-11-22 16:47

If I have a radio group with buttons:

\"Image

... how can I show only images in the select option i

8条回答
  •  Happy的楠姐
    2020-11-22 17:17

    Example:

    Heads up! This solution is CSS-only.

    Credit-card selector, the MasterCard on the modded demo is hovered.

    I recommend you take advantage of CSS3 to do that, by hidding the by-default input radio button with CSS3 rules:

    .options input{
        margin:0;padding:0;
        -webkit-appearance:none;
           -moz-appearance:none;
                appearance:none;
    }
    

    I just make an example a few days ago.

    • JSFiddle
    • How to use images for radio-buttons - Gist

提交回复
热议问题