假设我们有一个<label>
其中有<span>
兄弟姐妹。现在我想选择跨度并在其上应用一些样式。说:设计一个嵌套的HTML标签
<label class="checkbox-inline" for="currentDate">
<input type="checkbox" checked="checked" id="currentDate" />
<span><spring:message code='Admin.News.NewsDate.CurrentDate' /></span>
</label>
<span tooltip="<spring:message code='Admin.News.NewsDate.Tooltip' />" class="help-button">?</span>
我想这有help-button
,因为它的同胞类跨度chechbox-inline
等级标识,获取padding-left: 0px;
你想选择跨度只有当它是一个兄弟的div?或者是什么? – inorganik
我觉得你的问题与此类似:http://stackoverflow.com/questions/1817792/is-there-a-previous-sibling-css-selector – otaviko
请阅读更新 –