Sublime Forum

Only am able to use the font "sans-serif"

#1

I do not know what I am doing wrong. I was learning how to make a basic html and the YouTuber was able to us the code:

font-family: Arial, Helvetica, sans-serif

I attempt to do the same, but “sans-serif” is the only one that works.
Can someone explain to me how to fix this?
I am on Windows 10, Sublime 3

0 Likes

#2

Hi, first of all this forum is about “technical support” of SublimeText program, your question is about how to write html, anyway, I’ll try to help you out…
How can you tell that “sans-serif” is the only one working? All 3 specified families are “sans” and “sans-serif” is a sort of wildcard that let the browser pick up the first (sans) system font, to be sure try to put “arial, helvetica, serif”, that way you’ll see if previous families are available or not (if not you’ll see Times New Roman, or whatever serif font is you system’s primary serif, rendered instead).
I would also suggest you to look this https://www.w3schools.com/ , imho a better starting point to learn html than a youtube channel…

0 Likes

#3

Hi! My bad. I thought it would apply to “technical support”. I did as you said and I am unsure if it is working. It seems as though typing it as you said only accepts the “sans” part.
I tried removing “arial, helvetica” and when I reloaded it, the font did not change. I did the same with the one that had “sans-serif” and had the same type of results.
css%20help
Also, thank you so much for your response! I really appreciate it. I will definitely be using the website you sent. However, I just wanted to see how I could fix the issue I am currently having.

0 Likes

#4

To provide more insight, these are the only fonts it will accept. These are the only types that will modify the fonts on the html.

0 Likes

#5

The syntax highlighting for CSS in Sublime only specially highlights the values for font-family that CSS defines as known fallback family names; other font families such as arial are not highlighted specially because they’re not predefined (i.e. you can put any font family in there that you want).

As such, the code is still valid CSS even if the syntax highlighting doesn’t make it appear so; what it’s trying to tell you is that some of the font families are ones that are predefined and others are not, which isn’t actually a problem.

If the font doesn’t change then that’s a separate issue that’s outside of the purview of Sublime, like you don’t have the font installed that you’re asking the browser to use, the browser has been told not to use other fonts, etc.

That’s why your question falls outside of the realm of questions that might get an answer on the forum and why it might be better to ask in a more HTML specific forum, for example.

0 Likes

#6

Oh okay. I understand now. Thank you!

0 Likes