How to Upload Your Own Fonts to HTML Using CSS
How to Upload Your Own Fonts to HTML Using CSS
Are you creating a website? Adding your own custom fonts on your webpage can make it more attractive and unique, compared to using the standard fonts. With the help of CSS, you can truly customize your webpage and help it stand out! This article includes an easy method you can use to apply your own fonts in HTML.
Steps

Create a basic HTML webpage using any text editor tool. For example, you could be using Notepad, a free Windows system application. If you've already done this, you may skip this step. You should include the basic structure of an HTML document.

Create a new font-face. Under your

Title Using my Own Font

I used my own font!

Name your font. Use the font-family: property in between the parenthesis of the @font-face{} property. The font-family name indicates how you refer to it throughout your HTML document. A semicolon should be inserted after each property within a CSS style, indicating they're separated.

Title Using my Own Font

I used my own font!

Add your font file. Use the src=url () property in between the parenthesis of the @font-face{} property, mentioning the font file in between the parenthesis of the src=url () property. CSS accepts TTF, OTF, WOFF, SVG, and EOT font-file formats. Ensure your font file is saved in the same location as your HTML file, if not, specify the file's location. For example, /downloads/customfont.ttf. A semicolon should be inserted after each property within a CSS style, indicating they're separated.

Title Using my Own Font

I used my own font!

Edit your text. Create a new style attribute under the style tag, specifying which attribute you'd like to edit. For this example, we will be changing the title's font using h1 {}

Title Using my Own Font

I used my own font!

Add your font to your text. Use the font-family: property under your newly created style property, specifying your font's name after the colon. A semicolon should be inserted after each property within a CSS style, indicating they're separated.

Title Using my Own Font

I used my own font!

Color your text. Use the color: property under your text's created style property, specifying your desired font's color after the colon. A semicolon should be inserted after each property within a CSS style, indicating they're separated.

Title Using my Own Font

I used my own font!

Change your font size. Use the font-size: property under your text's created style property, specifying your desired font's size in pixels after the colon. A semicolon should be inserted after each property within a CSS style, indicating they're separated.

Title Using my Own Font

I used my own font!

Save your file using the .html extension. Press "File" and "Save as," name your file and ensure to add the .html towards the end. This step is important, as your file will only be considered a text file if you do not change the extension.

Test your font. If done correctly, your text should now be displayed using your custom font. The location of the text depends on where you've applied the font.

What's your reaction?

Comments

https://shivann.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!