styled checkboxes overlap in table

余生长醉 提交于 2019-12-13 05:01:44

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!