Web fonts are fonts that you can embed into your web page, giving you more design freedom. Instead of relying on default system fonts, you can use custom fonts from services like Google Fonts or Adobe Fonts, ensuring consistency across devices and browsers.
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap'); body { font-family: 'Roboto', sans-serif; }
This text is using the 'Roboto' font from Google Fonts.
@import
โ Imports the font from an external source like Google Fonts.font-family:
โ Defines the font used for the text (e.g., 'Roboto', sans-serif).font-weight:
โ Controls the thickness of the font (e.g., 400 for normal, 700 for bold).font-size:
โ Sets the size of the font.When using web fonts, it's best to keep your font sizes flexible. Use relative units like em
or rem
instead of fixed pixel sizes to ensure better responsiveness across different screen sizes.
Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!