O'Reilly logo

Responsive Web Design with HTML5 and CSS3 by Ben Frain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Help—my CSS3 @font-face headings look messy

This problem drove me to distraction when I first started using @font-face fonts to set my web typography free. It's not particular to responsive designs, it can happen with any heading that has a @font-face font applied. Here's a portion of a design composite I was working on:

Help—my CSS3 @font-face headings look messy

When I had built the site, the relevant markup was as follows:

<div class="intro">
<h1>We're Bridestone: <span>providing <b>beautiful</b> quality <i>natural</i> stone products.</span></h1>
  …more code…
</div> <!-- intro:END -->

And here was the relevant CSS:

.intro h1 { font-family: CaudexBold, "Times New Roman", Times, serif; font-size: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required