Che Hei Cheung1,438 Points
Do I have to make font changes in both html and css? It seems that only changing in css will change the fonts
I have made changes of fonts on html, but no effects. Only making changes on css will have the effect. Why is that?
Jennifer NordellTreehouse Moderator
Hi there! Alexander Davison is correct. HTML is the structure of your document. CSS is the styling of your document. So HTML simply defines the elements to be rendered on the page and the general attributes that don't necessarily have to do with styling. The
alt attributes are good examples of these.
However, it's also possible to include "in-line" CSS in the HTML or even a
<style> section that contains CSS inside the HTML document. Most often, though, we link to an external file. The question here then would be, how did you implement the font sizes in the HTML document you were working on?
We'd need to see your code to tell you why an in-line style might not be working. It should, as the specificity would have a higher priority than any linked documents or anything in the
Hope this helps!
HTML isn't for doing things like changing fonts, changing colors, changing sizes, etc., HTML is used for making the bare bones of a site. For example, you should use HTML to add text to a website, and you should use CSS to change the color of that text.
Good luck! ~Alex