How to modify font family and style simultaneously? [SOLVED] | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

How to modify font family and style simultaneously? [SOLVED]

Let's suppose I want to change the font style and family for a particular paragraph simultaneously. So, is there any method?

8th Mar 2024, 9:14 AM
Harsh
Harsh - avatar
7 Réponses
+ 4
"cursive" is a generic name for a font type: There are different cursive fonts, and when you only write "cursive" it will fall back to whatever the browser chooses as cursive font. They list a few examples of cursive fonts here: https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
8th Mar 2024, 12:11 PM
Lisa
Lisa - avatar
+ 2
Harsh Times New Roman is not a cursive font, so it will not work. Perhaps you can use Google fonts and use a font you like.
8th Mar 2024, 11:48 AM
Bob_Li
Bob_Li - avatar
+ 1
add or remove a css class.
8th Mar 2024, 9:55 AM
Lisa
Lisa - avatar
+ 1
Bob_Li So other than Arial, there isn't any font which is present in cursive?
8th Mar 2024, 11:55 AM
Harsh
Harsh - avatar
+ 1
Brush Script MT is a choice, but if you can access google fonts, there are other better options. https://www.w3schools.com/cssref/css_websafe_fonts.php
8th Mar 2024, 11:59 AM
Bob_Li
Bob_Li - avatar
0
or maybe you mean a css shorthand? <p style="font: 30px Arial, sans-serif;">Hello</p> <p style="font:italic small-caps bold 25px/30px Georgia, serif">Hello</p> https://www.w3schools.com/css/css_font_shorthand.asp
8th Mar 2024, 10:25 AM
Bob_Li
Bob_Li - avatar
0
Lisa Just like Bob_Li said about:- <p style="font: 30px Arial, sans-serif;"> Can't we just do it like Times New Roman as well as Cursive simultaneously? Like <p style="font: Times New Roman, cursive">?
8th Mar 2024, 11:28 AM
Harsh
Harsh - avatar