×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

SIGN IN YOUR ACCOUNT TO HAVE ACCESS TO DIFFERENT FEATURES

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR DETAILS?

AAH, WAIT, I REMEMBER NOW!

CREATE ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • SUPPORT

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

What are the two methods for importing new fonts into a website?

by EITCA Academy / Monday, 07 August 2023 / Published in Web Development, EITC/WD/HCF HTML and CSS Fundamentals, Advancing in HTML and CSS, Importing new fonts, Examination review

There are two primary methods for importing new fonts into a website: using a font hosting service or using the @font-face rule in CSS. Both methods allow web developers to enhance the typography of their websites by using custom fonts that are not commonly available on users' devices.

The first method involves using a font hosting service. Font hosting services, such as Google Fonts or Adobe Fonts, provide a wide range of fonts that can be easily imported into a website. To use a font from a hosting service, you need to include a link to the font in the HTML file of your website. This link is typically provided by the hosting service and includes a reference to the font file and some additional CSS code. For example, to import a font from Google Fonts, you would include a link like this in the head section of your HTML file:

html
<link href="https://fonts.googleapis.com/css2?family=FontName&display=swap" rel="stylesheet">

Once the link is added, you can use the imported font in your CSS code by specifying the font-family property with the name of the imported font. For example:

css
body {
  font-family: 'FontName', sans-serif;
}

The second method involves using the @font-face rule in CSS. This method allows you to import custom font files directly into your website. To use this method, you need to have the font files (in different formats like .woff, .woff2, .ttf, etc.) and include them in your project directory. Then, in your CSS code, you can define a new font face using the @font-face rule. Here's an example:

css
@font-face {
  font-family: 'FontName';
  src: url('fontname.woff2') format('woff2'),
       url('fontname.woff') format('woff');
}

In this example, the font files "fontname.woff2" and "fontname.woff" are located in the same directory as the CSS file. Once the font face is defined, you can use the imported font in your CSS code by specifying the font-family property with the name of the imported font, just like in the previous method.

Both methods have their advantages and considerations. Using a font hosting service is convenient because it provides a wide range of fonts and takes care of font file optimization and delivery. However, it relies on an external service and may introduce some performance overhead. On the other hand, using the @font-face rule gives you more control over the font files and allows you to use custom fonts that are not available on hosting services. However, you need to ensure that you have the appropriate font file formats and consider the impact on page load times.

Importing new fonts into a website can be achieved using either a font hosting service or the @font-face rule in CSS. Both methods enable web developers to enhance the typography of their websites and create a more visually appealing user experience. The choice between the two methods depends on factors such as font availability, performance considerations, and personal preferences.

Other recent questions and answers regarding Advancing in HTML and CSS:

  • What of adding border size in CSS?
  • How can we control the layout of content within a wrapper?
  • What are some benefits of using a wrapper in web development?
  • What is the role of the `<div>` tag in creating a wrapper?
  • How do we create a wrapper in HTML?
  • What is the purpose of creating a wrapper in HTML?
  • What is the significance of the `:hover` selector in CSS when styling a navigation menu?
  • How can we style a navigation menu using CSS?
  • What HTML element is commonly used to represent each menu item in a navigation menu?
  • How can we create a basic navigation menu in HTML?

View more questions and answers in Advancing in HTML and CSS

More questions and answers:

  • Field: Web Development
  • Programme: EITC/WD/HCF HTML and CSS Fundamentals (go to the certification programme)
  • Lesson: Advancing in HTML and CSS (go to related lesson)
  • Topic: Importing new fonts (go to related topic)
  • Examination review
Tagged under: CSS, Font-face, Fonts, HTML, Web Development
Home » Advancing in HTML and CSS / EITC/WD/HCF HTML and CSS Fundamentals / Examination review / Importing new fonts / Web Development » What are the two methods for importing new fonts into a website?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (106)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Reddit publ.)
  • About
  • Contact
  • Cookie Policy (EU)

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on Twitter
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF), governed by the EITCI Institute since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    Follow @EITCI
    EITCA Academy

    Your browser doesn't support the HTML5 CANVAS tag.

    • Cybersecurity
    • Quantum Information
    • Web Development
    • Artificial Intelligence
    • Cloud Computing
    • GET SOCIAL
    EITCA Academy


    © 2008-2026  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    CHAT WITH SUPPORT
    Do you have any questions?
    We will reply here and by email. Your conversation is tracked with a support token.