Style Radio Button with no label using css

How i can style my radio button with no label like shown below

enter image description here

Thanks.

1 answer

  • answered 2019-11-14 05:48 Udhay Titus

    Use css for radio button like this

    body {
        padding: 25px;
    }
    .radio {
      position: relative;
      float: left;
      clear: left;
      display: block;
      padding-left: 40px;
      margin-bottom: 12px;
      line-height: 22px;
      font-size: 18px;
      color: #666;
      cursor: pointer;
    }
    .radio:before {
      background: #fff;
      content: "";
      position: absolute;
      display: inline-block;
      top: 0;
      left: 0;
      width: 22px;
      height: 21px;
      border: 1px solid #bbb;
    
      border-radius: 100%;
      -moz-border-radius: 100%;
      -webkit-border-radius: 100%;
    
      box-shadow: inset 0 0 3px 0 #ccc;
      -moz-box-shadow: inset 0 0 3px 0 #ccc;
      -webkit-box-shadow: inset 0 0 3px 0 #ccc;
    }
    input[type="radio"] {
      display: none;
    } 
    input[type="radio"]:checked + label:before {
      content: "\2022";
      text-align: center;
      line-height: 15px;
      font-family: Tahoma;
      font-size: 44px;
      color: #000;
      text-shadow: 0 0 4px #bbb;
    }
    <input id="radio1" type="radio" name="radio">
    <label for="radio1" class="radio"></label>