is it possible to change font color across several divs and spans with css?
For example, I have HTML that goes like this:
some text ### some text
<div> some text in div</div>
some text
<div> some text
<span>some text</span>
</div>
some ### more text
Is there a way to change the color of the text to, let's say, red between the ### marks?
PS. The question is not about scripting, the question about the resulting markup/css itself.
Always wrap the text like in your example in span
tag. Don't throw the text like that. With that said, in general you can specify in .css file color
property for span
.
span{ color: Red }
But if you want specific span in a div to have a specific color then -
<div class="someClass">
<span>some text</span>
</div>
In .css,
.someClass { /* properties for the div */ }
.someClass span { color: Blue; /* other font properties */ }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With