1

I've been trying to style some radio buttons on a form but since styling them, I can't seem to select them...

The CSS I have is:

.radio-toolbar input[type="radio"] {
  display: none;
  margin: 10px;
  // text-align: center;
}
.radio-toolbar label {
  display: inline-block;
  background-color: transparent;
  border-style: solid;
  border-width: 1px;
  border-color: white;
  padding: 8px 50px;
  color: white;
}
.radio-toolbar input[type="radio"]:checked + label {
  background-color: white;
  color: gray;
}

And the radio buttons are (HAML):

.form-group
      .col-sm-10.radio-toolbar
        - YearGroup.all.each do |year_group|
          = f.radio_button(:year_group_id, year_group.id)
          = label_tag dom_id(year_group), year_group.name
      = f.label :year_group

Any ideas on why I can't select them?

camillavk
  • 521
  • 5
  • 20

1 Answers1

0

Use opacity:0 not display:none

.radio-toolbar input[type="radio"] {
  opacity:0; 
  margin: 10px;
  // text-align: center;
}