Use the “Lobotomized Owl” Selector
It may have a strange name but using the universal selector (*
) with the adjacent sibling selector (+
) can provide a powerful CSS capability:
* + * {
margin-top: 1.5em;
}
In this example, all elements in the flow of the document that follow other elements will receive margin-top: 1.5em
.
For more on the “lobotomized owl” selector, read Heydon Pickering’s post on A List Apart.
Demo
当前内容版权归 AllThingsSmitty 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 AllThingsSmitty .