How to change font in HTML? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to change font in HTML?

12th Aug 2017, 8:50 AM
Sagar Moriya
Sagar Moriya - avatar
4 Answers
+ 13
can use the font-family attribute or with JS as in the example code https://code.sololearn.com/WxqeT5JOoUkW/?ref=app
12th Aug 2017, 9:17 AM
Burey
Burey - avatar
+ 7
write in the style attribute: style="font-family:TH Sarabun New;" in some text tags likes p,h1,h2,h6 ...
12th Aug 2017, 9:12 AM
Nithiwat
Nithiwat - avatar
+ 5
For Previous versions of HTML , you can use <Font face = 'Callibri'> Text </font> For HTML 5 , use inline styling using style attribute. Example - <p style='font-family: Segoe Ui Light'> Text </p>
12th Aug 2017, 2:13 PM
un1xx
un1xx - avatar
+ 3
By using the style attribute, here's an example: <p style="font-family:Arial;>My font is Arial.</p> But I recommend to use CSS in changing fonts.
12th Aug 2017, 9:10 AM
Roie