Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how to use @font-face

Featured Replies

You can generate everything you need here http://www.fontsquirrel.com/tools/webfont-generator this will create a package of all the different font types and css you need for most, if not all browsers. I am on my ipad so cannot view your html and css but am presuming you are trying to use only one type

Edited by Fuzzy Logic

Hi @cairns84,

 

Currently, in your CSS you have:

 

@font-face {
    font-family: 'African'; /*a name to be used later*/
    src: url('fonts/african'); /*URL to font*/
}

You're not specifically referencing any files! As an example, it should follow the following format:

 

@font-face {
	font-family: 'AfricanFont';
	src: url('african-font.eot'); /* IE9 Compat Modes */
	src: url('african-font.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
	     url('african-font.woff') format('woff'), /* Modern Browsers */
	     url('african-font.ttf')  format('truetype'), /* Safari, Android, iOS */
	     url('african-font.svg#svgFontName') format('svg'); /* Legacy iOS */
	}

First line, you are declaring the font family name; secondly, you are telling the browser where to find the specific file for that font.

 

Then to apply that font to a specific element, eg h1 you do the following:

 

h1 {
       font-family: 'AfricanFont', (some-fallback), (font-style: eg, serif or not);
}
  • Author

thanks very much guys. the african font was curropt so i used a smilliar one and ran it through font squirrel and its working great now thank you

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.