+ 4

How to change the font in html page ?

3rd Jun 2017, 3:27 PM
Darsan Dev S
Darsan Dev S - avatar
8 Réponses
+ 19
<body style = "font-family: arial"></body> Change "arial" with your font, cheers. :)
3rd Jun 2017, 3:29 PM
Maz
Maz - avatar
+ 6
* { font-family: Arial; } /* This works as best */
3rd Jun 2017, 3:41 PM
$machitgarha
$machitgarha - avatar
+ 3
@Darsan Dev S You can create CSS file includes the following code to set fonts: /* Filename: fonts.css */ @font-face { font-family: defaultFont; /* Name */ src: url(font_address.ttf); /* Path */ } Then, import fonts in your main CSS page and use them using this code: /* Main styles file (e. g. styles.css) */ /* Import fonts.css to use defaultFont */ @import "fonts.css"; /* Set all element fonts: */ * { font-family: defaultFont, sans-serif; /* The second parameter of above line is to set another font when defaultFont not found. */ } Notices: Importing fonts is better because it prevents to code in every CSS file to set fonts. @font-face is to set fonts that is on your server. The advantage is the fonts always working, even the user doesn't have them in his computer.
5th Jun 2017, 2:50 PM
$machitgarha
$machitgarha - avatar
+ 2
@ujjwal pls tell me how to link font
5th Jun 2017, 4:32 AM
Darsan Dev S
Darsan Dev S - avatar
+ 2
@Darsan Dev S Didn't understand?
5th Jun 2017, 11:45 PM
$machitgarha
$machitgarha - avatar
+ 1
<head> <style> p{ font-family: Arial,Serif; } </style> </head> /* If the browser don't read arial it will read Serif */
4th Jun 2017, 3:34 PM
ismail norri
ismail norri - avatar
+ 1
you can link font to webpage using link element many font are in website google font take from there and link to your webpage and use it
4th Jun 2017, 4:14 PM
Ujjwal
Ujjwal - avatar
+ 1
I just started to study css.
5th Jun 2017, 5:30 PM
Darsan Dev S
Darsan Dev S - avatar