Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
目前,我有这个选择器:
.form .mid td p:last-child:not(:only-child) { margin-bottom: 0; }
它没有按预期工作。P仅当内部有多个边距时,我才想删除边距TD
P
TD
如果您td包含的不仅仅是p元素(我不知道,因为您没有显示您的标记),您可能想要使用:last-of-typeand:only-of-type来代替:
td
p
:last-of-type
:only-of-type
.form .mid td p:last-of-type:not(:only-of-type) { margin-bottom: 0; }