Fonts in CSS

font property lets you define fonts.
  • font-family - family-name,generic-family - Arial, serif
  • font-style - normal|italic
  • font-variant - normal | small-caps
  • font-weight - bold|bolder|normal|lighter
  • font-size - small|large|larger

External Font

You can also use third party fonts e.g. google. Here is an example showing how to use google font using link tag or @import syntax.

<!--  You can use @import syntax -->
@import url('');

<!--  or you can use link -->
<link rel="preconnect" href="">
<link rel="preconnect" href="" crossorigin>
<link href="" rel="stylesheet">

<!--  Then apply font -->
<div style="font-family: 'Roboto', sans-serif;">Your text</div>

Web development and Automation testing

solutions delivered!!