Html Can';t选择子元素
途中有一个Html Can';t选择子元素,html,css,css-selectors,Html,Css,Css Selectors,途中有一个img元素和一个br元素 如果要选择以下所有spans,请使用~组合器: .description_gifts > span:first-child{} .description_gifts > span:first-child + span{} // dont work 如果只想选择下一个span,请改用:nth-of-type(): .description_gifts > span:first-child ~ span 或者只需单步通过img和br即可
img
元素和一个br
元素
如果要选择以下所有span
s,请使用~
组合器:
.description_gifts > span:first-child{}
.description_gifts > span:first-child + span{} // dont work
如果只想选择下一个span
,请改用:nth-of-type()
:
.description_gifts > span:first-child ~ span
或者只需单步通过img
和br
即可:
.description_gifts > span:nth-of-type(2)
途中有一个
img
元素和一个br
元素
如果要选择以下所有span
s,请使用~
组合器:
.description_gifts > span:first-child{}
.description_gifts > span:first-child + span{} // dont work
如果只想选择下一个span
,请改用:nth-of-type()
:
.description_gifts > span:first-child ~ span
或者只需单步通过img
和br
即可:
.description_gifts > span:nth-of-type(2)
你到底想进入哪个元素?你到底想进入哪个元素?