05. Applying Styles to your Font bolding, italicizing

Now we can begin to style and decorate our fonts!

Bolding Text

For bolding, we use the font-weight property.

The values range from 100 to 900 in increments of 100. You may also place predefined values such as lighter, normal (same as 400), bold (700) and bolder.

p {
  font-style: bolder;
}

Italicizing Text

For italics, we use the font-style property.

Values include normal, italic and oblique.

Oblique is different from italic, in that it distorts the glyphs.

a {
  font-style: italic;
}

What about em/strong?

Wait a second...But I learned that em/strong is used for italicizing and bolding! Yes...and no.

The emphasis and strong tags indeed have a italics/bold default set on browsers, but should only be used for semantics. This means that you should only use them to actually emphasize a word or text, not just to bold or italice it for style.

Build modern and responsive webpages

JavaScript & JQuery

Build modern and responsive webpages Try Front-end

This book was written for anyone who wants to use JavaScript to make their websites a little more interesting, engaging, interactive, or usable. In particular, it is aimed at people who do not have a degree in computer science (well, not yet anyway).

$ Check price
39.9939.99Amazon 4.5 logo(385+ reviews)

More Front-end resources

Aching back from coding all day?

Acupressure Mat & Pillow

Aching back from coding all day? Try Back Problems

Relieve your stress, back, neck and sciatic pain through 1,782 acupuncture points for immediate neck pain relief. Made for lower, upper and mid chronic back pain treatment, and improves circulation, sleep, digestion and quality of life.

$$ Check price
144.87144.87Amazon 4.5 logo(1,890+ reviews)

More Back Problems resources

Ad