css - Styling a nested HTML tag -
suppose have <label>
has <span>
sibling. want select span , apply style on it. say:
<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>
i want label class chechbox-inline
has span class help-button
it's sibling, gets padding-left: 0px;
the following code select span , set style
.checkbox-inline > .help-button { padding-left: 100px; }
here working jsfiddle:https://jsfiddle.net/trtlf52b/
Comments
Post a Comment