b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Website Skins/Themes
  4. How to add a Google Font (WebFont) ?

How to add a Google Font (WebFont) ?

Google offers many webfonts that your are free to use. You can pick and choose here: https://fonts.google.com

Once you have selected the fonts you are interested in, here’s how you can quickly add them to b2evolution without editing any file. (If you want to work with CSS files, see: How to add custom CSS.)

Let’s say you decided to use the fonts Roboto (with a weight of 300) and Open-Sans…

All you need to do is go to your Collection’s Advanced properties and enter, the following lines of code into into the Skin and Style Panel Panel, like this:

How to add a Google Font (WebFont) ?

What the code actually means

<link href="https://fonts.googleapis.com/css?family=Open+Sans|Roboto:300" rel="stylesheet"></link>

This loads the 2 selected fonts from Google into your webpage. This code is provided to you by Google when you select your fonts.

<style>
    h1, h2, h3, h4, h5, h6 { 
        font-family: 'Roboto', sans-serif; 
    }
    #skin_wrapper { 
        font-family: 'Open Sans', sans-serif; 
    }
</style>

This is a little bit of CSS that specified where the fonts should be used. More specifically: where you want to override the defaults specified by your Skin.

This part of the code is not fully povided to you by Google because Google can’t know exactly where you want to use the fonts. So let’s dig deeper into what the code means.

First we define a block of custom CSS code:

<style>
.
.
.
</style>

Then we decide which font to use for all text in the skin:

#skin_wrapper { 
        font-family: 'Open Sans', sans-serif; 
    }

Note that #skinwrapper defines the part of the page that is NOT the evobar or any other tool that is not part of your skin.

Finally, we decide which font to use for all Headings (Titles):

    h1, h2, h3, h4, h5, h6 { 
        font-family: 'Roboto', sans-serif; 
    }

Created by fplanque • Last edit by fplanque on 2016-09-08 18:50 • •

No feedback yet

On this page

  • What the code actually means

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
      • Skin Development Primer
      • Loading additional resources into a skin
      • Where are the skin files?
      • CSS Guidelines
      • Targeted CSS Selectors
      • Introducing evoSkins
      • Modifying evoSkins
      • Creating evoSkins
      • Skin Tags / API
      • Styling widgets
      • Skin Quality Control
      • Using HTML 5 tags
      • Using Custom Item Templates
      • Using bootstrap classes in footers
      • Using Grunt
      • Dev Menu
      • How to add a Google Font (WebFont) ?
      • Custom Fields in a Template
      • Site Skins
    • Email Skins/Themes
    • b2evolution Files
    • Website Integration
    • Plugins
    • Debugging
    • Technical Reference
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
CMS + user community

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque