Consider using a tool like normalize.css to achieve consistent styling across different browsers. By implementing this reset stylesheet, you can avoid the need for browser-specific style adjustments.
/**
* To prevent issues with box sizing, padding, and width in Firefox,
* it's best not to style these elements.
*
* 1. Fix box sizing issue in IE 8/9/10.
* 2. Remove extra padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
You can then choose how you want to align the checkboxes, such as:
input[type=checkbox], input[type=radio] {
vertical-align: middle;
position: relative;
bottom: 1px;
}
input[type=radio] {
bottom: 2px;
}
Check out this live example:
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
input[type=checkbox], input[type=radio] {
vertical-align: middle;
position: relative;
bottom: 1px;
}
input[type=radio] {
bottom: 2px;
}
<label><input type="checkbox"> hello</label>