问题
I got this snippet from another question here on stackoverflow:
Snippet
If I put these checkboxes in a table, one checkbox per row, they overlap due to the padding of the labels. Why does this happen? Why doesn't the table cells change their height?
And how can I fix it?
Also, 'width: 100%' does not work for the label
回答1:
Try
tr {
display:block;
margin:10px 0px;
}
Or without adding table styles
label{
display: block;
}
Also, I made a codepen here
来源:https://stackoverflow.com/questions/27788308/styled-checkboxes-overlap-in-table