The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
2 posters

    what the best way to add a custom font in HTML page

    Michael_vx
    Michael_vx
    Forumember


    Male Posts : 659
    Reputation : 29
    Language : Arabic and some English
    Location : Egypt

    Solved what the best way to add a custom font in HTML page

    Post by Michael_vx Mon 27 Jul - 11:12

    what the best way to add a custom font in HTML page to work even if the user dose not have the font installed on his OS
    and to force the font i want to be in the page
    with any way
    thanks
    Hello


    Last edited by Michael_vx on Mon 27 Jul - 12:52; edited 1 time in total (Reason for editing : Solved)
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: what the best way to add a custom font in HTML page

    Post by Ange Tuteur Mon 27 Jul - 11:56

    You can usually import a font with CSS, such as Font Awesome or Google Fonts for example. The domain the fonts are hosted on however, needs to be cross domain. Otherwise, the font cannot be imported to your forum from another website.
    Michael_vx
    Michael_vx
    Forumember


    Male Posts : 659
    Reputation : 29
    Language : Arabic and some English
    Location : Egypt

    Solved Re: what the best way to add a custom font in HTML page

    Post by Michael_vx Mon 27 Jul - 11:58

    i want to custom a HTML page
    and do you mind Explain a bit more
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: what the best way to add a custom font in HTML page

    Post by Ange Tuteur Mon 27 Jul - 12:08

    Using google fonts for example, click "quick use" and it'll take you to a page with three codes. Since it's an HTML page you're using grab the standard link code and paste it in your head section.

    Example :
    Code:
    <!DOCTYPE html>
    <html>
      <head>
        <title>Page Title</title>
        <meta charset="UTF-8"/>
        <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/>
      </head>

      <body>

      </body>
    </html>

    Then you can use the font in a inline <style> tag.
    Code:
    <style type="text/css">
    body {
      font-family:'Open Sans', sans-serif;
    }
    </style>
    Michael_vx
    Michael_vx
    Forumember


    Male Posts : 659
    Reputation : 29
    Language : Arabic and some English
    Location : Egypt

    Solved Re: what the best way to add a custom font in HTML page

    Post by Michael_vx Mon 27 Jul - 12:34

    i understand now Smile
    thanks a lot
    thanks words are not Enough
    i still have much a lot to learn
    thank you again
    this topic is solved
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: what the best way to add a custom font in HTML page

    Post by Ange Tuteur Mon 27 Jul - 13:10

    You're welcome ^^

    Topic locked

    Google fonts would be the best font serving site that I know of, but I'm sure there may be more if you look. Have a great day ! Smile

      Current date/time is Sun 22 Sep - 19:31