Mobile app version of vmapp.org
Login or Join
Murray664

: CSS - Using different fonts within a typeface? After exploring typography more I've learnt the different between a typeface and a font :) I'd like to know how I can call the fonts 'Arial

@Murray664

Posted in: #Css #Fonts #Typography

After exploring typography more I've learnt the different between a typeface and a font :)

I'd like to know how I can call the fonts 'Arial Black' or 'Arial Narrow' within CSS? The font-family setting doesn't do it. Is this what the font-weight setting is for?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray664

3 Comments

Sorted by latest first Latest Oldest Best

 

@Kaufman565

The font-family property specifies the font for an element. It also requires the font to be installed on the end users operating system. This is why font stacks are used with multiple fallbacks all the way down to serif and sans-serif.
font-style specifies the style of the font such as italic or oblique. font-weight specifies the weight bold, normal, lighter, heavier or it can be expressed in numeric value.

body {
font-family: helvetica, arial, sans-serif;
font-weight: bold;
font-style: italic;
}

10% popularity Vote Up Vote Down


 

@Jamie315

You can put "Arial Black" or "Arial Narrow" in your font stack (put them in front if you want them to be the default), but if the user doesn't have them installed their browser will substitute the first font they have installed.

You can force the font on users using @font -face,but that takes some configuring. A good place to read up on how to that is www.fontsquirrel.com.

10% popularity Vote Up Vote Down


 

@Sims5801359

At least as far as CSS is concerned, these are different font families.

Note that if the font name includes spaces, you need to wrap it in quotes:

font-family: Arial;
font-family: "Arial Black";
font-family: "Arial Narrow";


You can choose the bold or italic fonts in a family like this:

font-family: Arial;
font-weight: bold;
font-style: italic;


If a family doesn't contain bold/italic/bold-italic fonts, they'll be simulated by distorting the base font. This should be avoided, as it doesn't usually look good.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme