I would like to style the ‘TextWithNoStyle’, but as it has no element, how can this be possible?
<div class=“MyClass”>
<a href=“#Something”>Some Text</a>
TextWithNoStyle
</div>
The style needs to affect only the ‘TextWithNoStyle’ text.
I would like to style the ‘TextWithNoStyle’, but as it has no element, how can this be possible?
<div class=“MyClass”>
<a href=“#Something”>Some Text</a>
TextWithNoStyle
</div>
The style needs to affect only the ‘TextWithNoStyle’ text.
3
Answers
Something like this?
You could add some default styles to
MyClass
then override them into thea
tag or others.Also you have css pseudo elements selectors like
:first-line
or:first-letter
I leave a link that answers this
Styling Text without HTML Tag?
Here’s a possible way: Do the styling with a css rule for
MyClass
, then create another rule for.MyClass > a
where you set the previously styled parameters toinitial
(i.e. their default value):Note:
a
has its owncolor
definition by default, you you don’t have to / shouldn’t reset it usinginitial
.