center radio button below label

后端 未结 3 1076
遇见更好的自我
遇见更好的自我 2021-01-04 19:58

Let\'s say I have some radio buttons with their labels looking like this:




        
3条回答
  •  半阙折子戏
    2021-01-04 20:24

    JSFIDDLE

    This alternative does not use div as wrappers, I use this to get a short DOM tree.

    /* center radio below label */
    
    .radioGroupBelow label {
      display: inline-block;
      text-align: center;
      margin: 0 0.2em;
    }
    .radioGroupBelow label input[type="radio"] {
      display: block;
      margin: 0.5em auto;
    }
    ​
    Fruits:

提交回复
热议问题