i don't know how to select only the h1 without the span in css HTML:
<h1>
<span>hello from spam</span>
<br>
heloo from h1
</h1>
i don't know how to select only the h1 without the span in css HTML:
<h1>
<span>hello from spam</span>
<br>
heloo from h1
</h1>
There are no parent selectors in CSS. Check:
Is there a CSS Parent selector?
What you can do is styling both elements and then re-writing the style for the child. e.g.:
h1{
color:blue;
}
h1 > span{
color:black;
}