HTML fonts code example
Example 1: css comic sans
font-family: "Comic Sans MS", "Comic Sans", cursive;
Example 2: font-style css
#example {
font-style: normal;
font-style: italic;
font-style: oblique;
font-style: inherit;
font-style: initial;
}
Example 3: font family css
font-family: "Comic Sans MS", cursive, sans-serif;
Add More Fonts Here : - https://fonts.google.com/
Example 4: css font
@font-face {
font-family: "Name of the font";
src: url("your/path/to/the.font");
}
p{
font-family: "Ubuntu";
}
Example 5: use font on website html
<style type="text/css">
@font-face {
font-family: "My Custom Font";
src: url(http://www.example.org/mycustomfont.ttf) format("truetype");
}
p.customfont {
font-family: "My Custom Font", Verdana, Tahoma;
}
</style>
<p class="customfont">Hello world!</p>
Example 6: sans serif font family css
<style>
.sansserif {
font-family: Arial, Helvetica, sans-serif;
}
</style>