0

I'd like to use a web-font in a blog post without having to change the entire website's code to incorporate it. Is there a way of adding a piece of @font-face code into the body section of a page without using external css or head code?

2 Answers2

0

You probably can.

Just include the web font and then inline some CSS that overrides the defaults.

Use !important to force some changes:

The !important exception

zaf
  • 22,776
  • 12
  • 65
  • 95
0

You can place <style type="text/css"></style> within the body and add the required CSS @font-face properties between these tags.

Barzev
  • 402
  • 3
  • 14
  • So this could presumably all be done at, say, a wordpress blog? – Steven Ellen Starar May 12 '16 at 18:07
  • Presumably, yes. I believe it depends on the flavor and configuration of Wordpress. You can also use a third party plugin such as [this one](https://wordpress.org/plugins/insert-html-snippet/). – Barzev May 14 '16 at 11:35
  • I tried using this method in blogger.com and it isn't showing, even tho the html looks okay: http://testiclessite.blogspot.co.uk/2016/05/test.html – Steven Ellen Starar May 14 '16 at 21:47
  • yeah V V – Steven Ellen Starar May 14 '16 at 21:47
  • Can you provide more information on where you're pasting this. Also, please format the code so it's readable. Please provide as much information as possible. – Barzev May 15 '16 at 20:07
  • Okay, I tried it here: http://testiccles.weebly.com/ and if you inspect the text "yeah VV" you'll see it is looking for the vidame font. You can see the actual font set for the span is "vidame" but it isn't loading it. The capitol V should appear as a symbol and it is being loaded from http://vidame.co/vidame_1-webfont.woff - I can't format the code in the comments? – Steven Ellen Starar May 15 '16 at 22:05
  • Seems like it's because the font is remotely hosted? http://blog.elevatorup.com/post/57689235448/remotely-hosted-web-fonts-and-cors – Steven Ellen Starar May 15 '16 at 22:30
  • Yes, that's correct. Do you have access to the .htaccess file? If so you can check this [stackoverflow](http://stackoverflow.com/questions/26125030/font-awesome-icons-not-showing-in-chrome-a-maxcdn-related-cross-origin-resource) thread for the correct solution. Here is another [support thread in WordPress regarding this issue](https://wordpress.org/support/topic/css-fonts-missing-no-access-control-allow-origin-header), especially since you mentioned that you're using that technology – Barzev May 16 '16 at 15:36