How do I apply both a style for color, such as <span style="color:#c00000">
and a class such as <span class="Bold">
to some text? I’ve tried the example below, but I’m very new to CSS and don’t quite understand yet how to apply both. In my example below, the color shows up but not the bold. Thanks for any help.
<span style="color:#c00000"class="Bold">Some text element</span>
2
Answers
you have it correct but need to add css font_weight:bold to the .Bold class
You can write all styles in
style
attribute by seperating with;
Or you can define a style for a class with css and use it from HTML
And still you can use
class
andstyle
attributes.And maybe you can learn more from W3Schools CSS and W3Schools html classes.