-1

the input type checkbox just wont work, chrome displays the default checkboxes while my other css cases work and display how they should.

.checkbox{
border: 2px solid white !important;
background:#121f20 !important;
color:white !important;
font-family: open sans !important;
font-weight: 900 !important;
font-size: 15px !important;
padding:5px !important;    
}

html

<table class="tableEnd">
  <tr>
    <td class="emptyTd"> 

      <input type="checkbox"  class="checkbox" name="checkbox" value="checkbox" /> I certify that I have read and agreed to the General Terms and Agreement <br>
      <input type="checkbox" class="checkbox" name="option" value="Check" > I certify that I have read and agreed to the Acceptable Use Policy       <br>

      <input type="checkbox" class="checkbox" name="option" value="Check"> I commission  to provision services immediately. Distance selling regulations do not apply<br></td>

  </tr> 
</table>

<table class="tableEnd">
  <tr> 
    <td class="coupon">Coupon <input type="text" name="coupon" value="code"> <input class="button" type="submit" value="Submit"></td>               
    <td class="payment" ><input class="button" type="submit" value="Order"></td>
  </tr>

</table>
redfirm
  • 13
  • 1
  • 3

3 Answers3

1

Checkbox does not support border and padding, thats why we use customize checkboxes useing javascript/jquery plugins.

There are lots of plugins available e.g. http://www.sitepoint.com/15-jquery-radio-button-checkbox-style-plugins/

Abdulla khan
  • 758
  • 5
  • 11
0

If you're wanting to style the text beside the checkbox you should wrap it in a label alongside your checkbox:

<label>
    <input type="checkbox"  class="checkbox" name="checkbox" value="checkbox" />
    I certify that I have read and agreed to the General Terms and Agreement
</label>

Note how I've also removed the br element.

You can then apply the styling to the label element itself:

label {
    border: 2px solid white;
    background:#121f20;
    color:white;
    display: block; /* Achieves the same effect of the now-removed br element. */
    font-family: open sans;
    font-weight: 900;
    font-size: 15px;
    padding:5px; 
}

If you're wanting to style the actual checkbox then you'll need to do some research into how to best achieve this, as most browsers do not apply any CSS to checkbox inputs. See: How to style checkbox using CSS?

Community
  • 1
  • 1
James Donnelly
  • 126,410
  • 34
  • 208
  • 218
0

None of the properties you are changing have any effect on checkboxes in Chrome.

They have no text, so font-family, font-weight and font-size are nonsense.

Some browsers (although I don't recall seeing one in a long time) support styling the border, background, color and padding of checkboxes, but Chrome does not.

People wanting to style them usually use hack involving hiding the checkbox itself and changing the appearance of the associated <label> element.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335