Helpful Information
 
 
Category: CSS Help
Importing Fonts with CSS

I'm pretty certain you can do this - but for the life of me I can't remember where I read this.


<style>
@import font("fonturl")
</style>


or



<style>
@font url("fonturl")
</style>


I'm still searching online.

Anyone else have any ideas?

thanks

The @import notation is just a an alternative to <style> so far as I can see...
You can use -
@import "mystyle.css";
or -
@import url("mystyle.css");

There's nothing in the specifications that says anything about importing fonts.
http://www.w3.org/TR/REC-CSS2/cascade.html#at-import

right after I posted, I found this on w3.org:


<STYLE TYPE="text/css" MEDIA="screen, print">
@font-face {
font-family: "Formata";
src: url("http://site/fonts/formata")
}
H1 { font-family: "Formata", "arial", "verdana", "helvetica" }
</STYLE>

I'm hoping it works and doesn't create too much more of a download time. (changed to my company's font.)

Thank you though :D

how do upload my fonts to my hosting? when I do, it becomes an empty file.

-macace8










privacy (GDPR)