: 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
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?
More posts by @Murray664
3 Comments
Sorted by latest first Latest Oldest Best
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;
}
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.
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.