Skip to content
Fix Code Error

How to add some non-standard font to a website?

March 13, 2021 by Code Error
Posted By: vaske

Is there a way to add some custom font on a website without using images, Flash or some other graphics?

For example, I was working on a wedding website, and I found a lot of nice fonts for that subject. But I can’t find the right way to add that font on the server. And how do I include that font with CSS into the HTML? Is this possible to do without graphics?

Solution

This could be done via CSS:

<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>

It is supported for all of the regular browsers if you use TrueType-Fonts (TTF), the Web Open Font Format (WOFF) or Embedded Opentype (EOT).

Answered By: hangy

Related Articles

  • insert tables in dataframe with years from 2000 to…
  • VUE Error when run test unit
  • Self-hosted fonts using NextJS
  • How do you use custom fonts with TailwindCSS and NuxtJS?
  • How to add fonts to create-react-app based projects?
  • Is CSS Turing complete?
  • After a little scroll, the sticky navbar just is not…
  • Pandas pivot_table: filter on aggregate function
  • Using fonts with Rails asset pipeline
  • Vue Cli 3 Local fonts not loading
  • Font is loaded but not applicated
  • Does moment.js allow me to derive a timezone…
  • Obtain most recent value for based on index in a…
  • How do i load custom fonts in polymer 2.x
  • How to use html template with vue.js
  • SQL find sum of entries by date including previous date
  • Use multiple @font-face rules in CSS
  • How to add multiple font files for the same font?
  • Use multiple custom fonts using @font-face?
  • How can I extract embedded fonts from a PDF as valid…
  • List of Timezone IDs for use with FindTimeZoneById() in C#?
  • How to properly do JSON API GET requests and assign…
  • I need to sum values with specific condition
  • flutter - add network images in a pdf while creating…
  • python 3.2 UnicodeEncodeError: 'charmap' codec can't…
  • Best way to extract messy HTML tables using BeautifulSoup
  • Pandas / Python - Compare numerically each row with…
  • Active tab issue on page load HTML
  • Azure Sql : Unable to Replace HTML String
  • NullpointerException error while working with…
  • Fix top buttons on scroll of list below
  • Why is @font-face throwing a 404 error on woff files?
  • How to host google web fonts on my own server?
  • How to include a font .ttf using CSS?
  • How to apply rolling t.test with pandas?
  • Can't install via pip because of egg_info error
  • How to embed fonts in HTML?
  • Add calculated column to df2 for every row entry in…
  • CSS @font-face not working with Firefox, but working…
  • Scope problems when using setTimeout in backbone.js
  • Best approach to real time http streaming to HTML5…
  • Import CSS file with Fonts in VueJS
  • Cannot make table responsive
  • How do i arrange images inside a div?
  • @font-face not working
  • Is it possible to apply CSS to half of a character?
  • including regression coefficient and pvalue in the ggplot2
  • Ubuntu apt-get unable to fetch packages
  • Adobe XD to responsive html
  • What are the new features in C++17?
  • Failed to decode downloaded font
  • how to include glyphicons in bootstrap 3
  • Version solving failing on running "flutter pub get"…
  • why req.body is empty and req.files undefined
  • Error 'Map', but got one of type 'Null' flutter web…
  • Moving average in MYSQL without dates but grouped by…
  • How to use commas in a CSS variable fallback?
  • Cannot embed custom fonts using vuejs2 and webpack
  • Sass relative modules not found?
  • VueJS masonry layout
  • Why should we include ttf, eot, woff, svg,... in a font-face
  • Custom font in Next.js + Tailwind: no error, but wrong font
  • How to add an Access-Control-Allow-Origin header
  • Failed to authenticate on SMTP server error using gmail
  • How get consecutives weeks in a group in df python?
  • Having trouble with my nav bar/header, It used to…
  • The 'compilation' argument must be an instance of…
  • How do I use .woff fonts for my website?
  • How can I pass a wct test while rearranging children…
  • Avoid creating new session on each axios request laravel
  • Current time formatting with Javascript
  • Event Snippet for Google only shows one event while…
  • How do i update a javascript variable as its value changes?
  • Next.js - Warning: Prop `dangerouslySetInnerHTML`…
  • How to use 2 columns as "key" to get MAX value of…
  • How to load a font file in vuejs and webpack?
  • problem with client server unix domain stream…
  • Link a .css on another folder
  • Click button copy to clipboard using jQuery
  • Python Monthly Change Calculation (Pandas)
  • How to parse JSON with XE2 dbxJSON
  • How to make the overflow CSS property work with…
  • C# parse FHIR bundle - read resources
  • why is my website is pushed to the left when…
  • How to embed fonts in CSS?
  • Search match multiple values in single field in…
  • Azure Availability Zone ARM Config
  • Where do I find the current C or C++ standard documents?
  • Add prefix to all img src in a array
  • Jquery fadeToggle Trouble
  • Python Seaborn: how to plot all columns and use…
  • Python - Modifying rows of a data frame where the…
  • display a flash message with events with vuejs
  • I cant get my type writer heading to the center of my code
  • Smart way to truncate long strings
  • How to use Apple's new San Francisco font on a webpage
  • How do you sign a Certificate Signing Request with…
  • How do I include certain conditions in SQL Count
  • Show scroll update when scrolling down page
  • Oracle sql query to group two sets of dates if sequencials

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

What’s causing my java.net.SocketException: Connection reset?

Next Post:

Scroll to bottom of div?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error