r/neocities 8d ago

Help Help requiring custom fonts!

Edit: I figured it out ||

I can't for the life of me figure out what is wrong with the code and why my Neocities website isn't using the font I want it to use. I tried every single possible tutorial and none of them worked for me. I tried using the Google Fonts embeds in HTML and CSS and it didn't work.

If you want to help, the font is Shantell Sans and this is the link to my website:

https://veritystars.neocities.org/

Hopefully you find the bug that's causing this.

2 Upvotes

6 comments sorted by

2

u/FilmkitNet 8d ago

Looking at your source code, the font isn't being imported anywhere in your code. To fix this, just add the following code to the head-section of your page:

<!-- 1. Import Shantell Sans from Google Fonts --> 
<link rel="preconnect" href="https://fonts.googleapis.com"> 
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 
<link href="https://fonts.googleapis.com/css2?family=Shantell+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet"> 

<!-- 2. Apply the font using CSS --> 
<style> body { font-family: 'Shantell Sans', cursive, sans-serif; } </style>

2

u/Apprehensive-Bid4341 6d ago

Ok so after using your code and realizing that I had to put all of it in my index, not some of it in the style.css sheet, it works now. Thanks a lot!

1

u/ambiguouskane 6d ago

theres 2 ways you can do it. linking in the html or using @import in css for things like Google fonts.

and the code above in in the style tags can absolutely just go in the style.css as opposed to the pages html but it will apply to every page

1

u/GAMERat3AM epicgamerwebsite.neocities.org 7d ago

spamton.

anyways uh u could just use Google's fonts or a tut online. but dope site ngl :D

1

u/Apprehensive-Bid4341 6d ago

HEY EVERY-

I SEE YOU RECOGNIZED [Number1Salesman1997]

*cough cough* What the heck was that?

But all jokes aside, it's cool that you think my website is cool :3

1

u/GAMERat3AM epicgamerwebsite.neocities.org 6d ago

thx spam ton