What is the correct way to change the color or font face for a single word or set of words within a sentence? I am using Twitter Bootstrap and want to inherit all the attributes of the <div>
's class, but only tweak them slightly.
Go to Format > Font > Font. + D to open the Font dialog box. Select the arrow next to Font color, and then choose a color.
How to Change Font Size in HTML. To change font size in HTML, use the CSS font-size property. Set it to the value you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a paragraph, heading, button, or span tag.
Going off of Chords
comment, you can create a <span>
tag that surrounds the text you want to change. You can easily add multiple classes to a single span to achieve just the look you want as well.
Here's a fiddle to show how you can use multiple classes on a single span.
CSS
.bold { font-weight: bold; }
.red { color: #FF0000; }
.yellow-background { background-color: Yellow; }
HTML
Here is <span class="bold">some text</span> that we are going to apply
<span class="bold red">different styles</span> to. You can see how
<span class="bold yellow-background">multiple classes</span> can be used to
change the <span class="red bold yellow-background">look and feel</span>
of the text.
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