21
readers helped!

This helped me

How to Change the Font Type Using HTML Programming

Coding an HTML page to use a certain font is a cool thing, and it styles a HTML page with the font of your choice. This article will explain how to do it.

Steps

  1. Step 1 Have your "HTML markup" well under way in your editor of choice.
    If you're new to this, look up instructions on creating your first HTML page.
  2. How.com.vn English: Step 2 Find the point in your HTML page where you would like to specify the font to be used.
    It will be at the start of the chosen text; a sentence or paragraph.
  3. Step 3 Remember that we tell the web browser, via our HTML, how to present our text using "attributes".
    These precede and end the piece we would like to alter the appearance of. These attributes are marked with special symbols which the browser recognizes as special commands to be used to control the content. These are < and >.
  4. How.com.vn English: Step 4 Know the initial part of the attribute.
    It is as follows:
    • <span style="font-family:name of font goes here">
    • The <font> tag can still be used, but it is deprecated. The face attribute of the <font> tag allows you to use a font locally installed on the system. You can also use fonts defined with the CSS @font-face at-rule.
  5. How.com.vn English: Step 5 Close the text with the following closing attribute, after specifying the section of it to be changed.
  6. How.com.vn English: Step 6 Go back to using the font and settings you normally use in your browser.
    Notice the slash on the opening "closing" attribute. That will give you the complete command in HTML.
    Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit

      Advertisement

      Video

      Tips

      • You cannot rely on a font existing on every machine which might browse your page. Common fonts such as Arial or Courier should be fine.
      • Notice they are separated by a comma.
      • However, there is a trick you can use to increase your chances of getting a font you want. This involves supplying a list of alternative fonts. They are presented in order of preference.
      Advertisement

      Warnings

      • If you really want to use a strange font you might create a graphic of the word(s) using the font and insert that instead. That way, it will be displayed exactly as you've created it.
      • As mentioned in the Tips section, you cannot assume that the machine someone is using to look at your website will have the font you've specified. So, try to avoid weird and exotic fonts.
      • A big caveat is that HTML5 will not be using this attribute and you will need to use CSS. If you want to know how to do this, you can look up instructions for it on the Internet.
      Advertisement

      About this article

      How.com.vn is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 10 people, some anonymous, worked to edit and improve it over time. This article has been viewed 37,362 times.
      How helpful is this?
      Co-authors: 10
      Updated: March 21, 2019
      Views: 37,362
      Thanks to all authors for creating a page that has been read 37,362 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement