This snippet doesn\'t work the way I expect:
As far as I can tell, no, you cannot differentiate between elements with or without a sibling text node using CSS alone:
div li span:first-child {
font-style: italic;
}
div li:first-child span {
font-weight: bold;
}
div li:empty span:first-child {
color:red;
}
div li span:only-child {
font-size: 20px;
}
- This is a test
- And this is also a test
- another test