SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
CSS - Fonts
This chapter teaches you how to set fonts of a content, available in an HTML
element. You can set following font properties of an element −
 The font-family property is used to change the face of a font.
 The font-style property is used to make a font italic or oblique.
 The font-variant property is used to create a small-caps effect.
 The font-weight property is used to increase or decrease how bold or light a font
appears.
 The font-size property is used to increase or decrease the size of a font.
 The font property is used as shorthand to specify a number of other font properties.
 Set the Font Family
 Following is the example, which demonstrates how to set the font family of an element.
Possible value could be any font family name.
<html>
<head>
</head>
<body>
<p style = "font-family:georgia,garamond,serif;">
This text is rendered in either georgia, garamond, or the
default serif font depending on which font you have at your system.
</p>
</body>
</html>
Set the Font Style
Following is the example, which demonstrates how to set the
font style of an element. Possible values are normal, italic and
oblique.
<html>
<head>
</head>
</html>
<body>
<p style = "font-style:italic;">
This text will be rendered in italic style
</p>
</body>
</html>
Set the Font Variant
The following example demonstrates how to set the font variant of an
element. Possible values are normal and small-caps.
<html>
<head>
</head>
<body>
<p style = "font-variant:small-caps;">
This text will be rendered as small caps
</p>
</body>
</html>
Set the Font Weight
The following example demonstrates how to set the font weight of an element. The font-
weight property provides the functionality to specify how bold a font is. Possible values
could be normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900.
<html>
<head>
</head>
<body>
<p style = "font-weight:bold;">
This font is bold.
</p>
<p style = "font-weight:bolder;">
This font is bolder.
</p>
<p style = "font-weight:500;">
This font is 500 weight.
</p>
</body>
</html>
Css   fonts
<html>
<head>
</head>
<body>
<p style = "font-size:20px;">
This font size is 20 pixels
</p>
<p style = "font-size:small;">
This font size is small
</p>
<p style = "font-size:large;">
This font size is large
</p>
</body>
</html>
Set the Font Stretch
The following example demonstrates how to set the font stretch of an element. This
property relies on the user's computer to have an expanded or condensed version of the
font being used.
Possible values could be normal, wider, narrower, ultra-condensed, extra-condensed,
condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded.
<html>
<head>
</head>
<body>
<p style = "font-stretch:ultra-expanded;">
If this doesn't appear to work, it is likely that your
computer
doesn't have a <br>condensed or expanded version
of the font being used.
</p>
</body>
</html>
Shorthand Property
You can use the font property to set all the font properties at
once. For example −
<html>
<head>
</head>
<body>
<p style = "font-stretch:ultra-expanded;">
If this doesn't appear to work, it is likely that your
computer doesn't have a <br>condensed or expanded version of
the font being used.
</p>
</body>
</html>
Css   fonts

More Related Content

PPTX
HTML: Tables and Forms
BG Java EE Course
 
PPTX
Html-list
Dhirendra Chauhan
 
PDF
Html text and formatting
eShikshak
 
PPTX
Css borders
AbhishekMondal42
 
PPTX
Css backgrounds
AbhishekMondal42
 
PPTX
(Fast) Introduction to HTML & CSS
Dave Kelly
 
PPTX
Html table
JayjZens
 
PPTX
HTML Forms
Nisa Soomro
 
HTML: Tables and Forms
BG Java EE Course
 
Html text and formatting
eShikshak
 
Css borders
AbhishekMondal42
 
Css backgrounds
AbhishekMondal42
 
(Fast) Introduction to HTML & CSS
Dave Kelly
 
Html table
JayjZens
 
HTML Forms
Nisa Soomro
 

What's hot (20)

PPTX
Elements of html powerpoint
Anastasia1993
 
PPTX
Complete Lecture on Css presentation
Salman Memon
 
PPTX
Lecture 2 introduction to html
palhaftab
 
PPTX
Html ppt
santosh lamba
 
PPT
Cascading Style Sheets (CSS) help
casestudyhelp
 
PPTX
Html links
JayjZens
 
PPTX
Html training slide
villupuramtraining
 
PPT
Eye catching HTML BASICS tips: Learn easily
shabab shihan
 
PPT
Html basics
mcatahir947
 
PDF
Div tag presentation
alyssa_lum11
 
PDF
Html frames
eShikshak
 
PPTX
presentation in html,css,javascript
FaysalAhammed5
 
PPTX
Html
Nisa Soomro
 
PDF
Lecture-3: Introduction to html - Basic Structure & Block Building
Mubashir Ali
 
PPTX
HTML Semantic Elements
Reema
 
PPTX
Html & CSS
JainilSampat
 
PDF
Introduction to XHTML
Hend Al-Khalifa
 
DOC
Web Design Notes
butest
 
PPT
Introduction to html
vikasgaur31
 
PPTX
HTML
chinesebilli
 
Elements of html powerpoint
Anastasia1993
 
Complete Lecture on Css presentation
Salman Memon
 
Lecture 2 introduction to html
palhaftab
 
Html ppt
santosh lamba
 
Cascading Style Sheets (CSS) help
casestudyhelp
 
Html links
JayjZens
 
Html training slide
villupuramtraining
 
Eye catching HTML BASICS tips: Learn easily
shabab shihan
 
Html basics
mcatahir947
 
Div tag presentation
alyssa_lum11
 
Html frames
eShikshak
 
presentation in html,css,javascript
FaysalAhammed5
 
Lecture-3: Introduction to html - Basic Structure & Block Building
Mubashir Ali
 
HTML Semantic Elements
Reema
 
Html & CSS
JainilSampat
 
Introduction to XHTML
Hend Al-Khalifa
 
Web Design Notes
butest
 
Introduction to html
vikasgaur31
 
Ad

Similar to Css fonts (20)

PPTX
1 7font css
gng542
 
PDF
Fonts
Ankit Dubey
 
PDF
Lecture 12 css_fonts
eShikshak
 
PPTX
Css font properties
Jesus Obenita Jr.
 
PPTX
Castro Chapter 10
Jeff Byrnes
 
PPT
Introduction to CSS Fonts, Texts and Colors - Lesson 7
Training n Development by Attitude
 
PPTX
Chapter 12: CSS Part 2
Steve Guinan
 
PPTX
Css Complete Notes
EPAM Systems
 
PPTX
Web Engineering - Introduction to CSS
Nosheen Qamar
 
PDF
cascading stylesheet_cssppt-100604051600-phpapp02.pdf
hinalsomani93
 
PPT
Lecture 5
uccwebcourses
 
DOCX
CSS properties.docx
bantisworld
 
PDF
Styling Text With CSS
Vidya Ananthanarayanan
 
PPTX
CSS ppt of cascading Style sheet for beginners.pptx
HarshSahu509641
 
PDF
Pemrograman Web 3 - CSS Basic Part 2
Nur Fadli Utomo
 
PDF
Css1 properties
Sahil Alipuria
 
DOC
Css1 properties
MP Bhoj University
 
PPTX
CSS tutorial chapter 2
jeweltutin
 
PDF
Intro to css & sass
Sean Wolfe
 
PPTX
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
eyasu6
 
1 7font css
gng542
 
Lecture 12 css_fonts
eShikshak
 
Css font properties
Jesus Obenita Jr.
 
Castro Chapter 10
Jeff Byrnes
 
Introduction to CSS Fonts, Texts and Colors - Lesson 7
Training n Development by Attitude
 
Chapter 12: CSS Part 2
Steve Guinan
 
Css Complete Notes
EPAM Systems
 
Web Engineering - Introduction to CSS
Nosheen Qamar
 
cascading stylesheet_cssppt-100604051600-phpapp02.pdf
hinalsomani93
 
Lecture 5
uccwebcourses
 
CSS properties.docx
bantisworld
 
Styling Text With CSS
Vidya Ananthanarayanan
 
CSS ppt of cascading Style sheet for beginners.pptx
HarshSahu509641
 
Pemrograman Web 3 - CSS Basic Part 2
Nur Fadli Utomo
 
Css1 properties
Sahil Alipuria
 
Css1 properties
MP Bhoj University
 
CSS tutorial chapter 2
jeweltutin
 
Intro to css & sass
Sean Wolfe
 
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
eyasu6
 
Ad

More from AbhishekMondal42 (20)

PPTX
Oss evaluation-certification-oss-financial-advantages
AbhishekMondal42
 
PPTX
Word press 01
AbhishekMondal42
 
PPTX
Word press posts(preview &amp; publish)
AbhishekMondal42
 
PPTX
Word press posts(add , edit , delete post)
AbhishekMondal42
 
PPTX
Word press pages(edit and delete)
AbhishekMondal42
 
PPTX
Word press pages(add)
AbhishekMondal42
 
PPTX
Word press media(add,insert,delete)
AbhishekMondal42
 
PPTX
Word press media library
AbhishekMondal42
 
PPTX
Word press widget management
AbhishekMondal42
 
PPTX
Word press view plugins
AbhishekMondal42
 
PPTX
Word press user roles
AbhishekMondal42
 
PPTX
Word press theme management
AbhishekMondal42
 
PPTX
Word press personal profile
AbhishekMondal42
 
PPTX
Word press moderate comments
AbhishekMondal42
 
PPTX
Word press install plugins
AbhishekMondal42
 
PPTX
Word press edit users
AbhishekMondal42
 
PPTX
Word press edit tags
AbhishekMondal42
 
PPTX
Word press edit links
AbhishekMondal42
 
PPTX
Word press edit comments
AbhishekMondal42
 
PPTX
Word press delete users
AbhishekMondal42
 
Oss evaluation-certification-oss-financial-advantages
AbhishekMondal42
 
Word press 01
AbhishekMondal42
 
Word press posts(preview &amp; publish)
AbhishekMondal42
 
Word press posts(add , edit , delete post)
AbhishekMondal42
 
Word press pages(edit and delete)
AbhishekMondal42
 
Word press pages(add)
AbhishekMondal42
 
Word press media(add,insert,delete)
AbhishekMondal42
 
Word press media library
AbhishekMondal42
 
Word press widget management
AbhishekMondal42
 
Word press view plugins
AbhishekMondal42
 
Word press user roles
AbhishekMondal42
 
Word press theme management
AbhishekMondal42
 
Word press personal profile
AbhishekMondal42
 
Word press moderate comments
AbhishekMondal42
 
Word press install plugins
AbhishekMondal42
 
Word press edit users
AbhishekMondal42
 
Word press edit tags
AbhishekMondal42
 
Word press edit links
AbhishekMondal42
 
Word press edit comments
AbhishekMondal42
 
Word press delete users
AbhishekMondal42
 

Recently uploaded (20)

DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Virus sequence retrieval from NCBI database
yamunaK13
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Basics and rules of probability with real-life uses
ravatkaran694
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 

Css fonts

  • 2. This chapter teaches you how to set fonts of a content, available in an HTML element. You can set following font properties of an element −  The font-family property is used to change the face of a font.  The font-style property is used to make a font italic or oblique.  The font-variant property is used to create a small-caps effect.  The font-weight property is used to increase or decrease how bold or light a font appears.  The font-size property is used to increase or decrease the size of a font.  The font property is used as shorthand to specify a number of other font properties.  Set the Font Family  Following is the example, which demonstrates how to set the font family of an element. Possible value could be any font family name.
  • 3. <html> <head> </head> <body> <p style = "font-family:georgia,garamond,serif;"> This text is rendered in either georgia, garamond, or the default serif font depending on which font you have at your system. </p> </body> </html>
  • 4. Set the Font Style Following is the example, which demonstrates how to set the font style of an element. Possible values are normal, italic and oblique. <html> <head> </head> </html> <body> <p style = "font-style:italic;"> This text will be rendered in italic style </p> </body> </html>
  • 5. Set the Font Variant The following example demonstrates how to set the font variant of an element. Possible values are normal and small-caps. <html> <head> </head> <body> <p style = "font-variant:small-caps;"> This text will be rendered as small caps </p> </body> </html>
  • 6. Set the Font Weight The following example demonstrates how to set the font weight of an element. The font- weight property provides the functionality to specify how bold a font is. Possible values could be normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900. <html> <head> </head> <body> <p style = "font-weight:bold;"> This font is bold. </p> <p style = "font-weight:bolder;"> This font is bolder. </p> <p style = "font-weight:500;"> This font is 500 weight. </p> </body> </html>
  • 8. <html> <head> </head> <body> <p style = "font-size:20px;"> This font size is 20 pixels </p> <p style = "font-size:small;"> This font size is small </p> <p style = "font-size:large;"> This font size is large </p> </body> </html>
  • 9. Set the Font Stretch The following example demonstrates how to set the font stretch of an element. This property relies on the user's computer to have an expanded or condensed version of the font being used. Possible values could be normal, wider, narrower, ultra-condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded. <html> <head> </head> <body> <p style = "font-stretch:ultra-expanded;"> If this doesn't appear to work, it is likely that your computer doesn't have a <br>condensed or expanded version of the font being used. </p> </body> </html>
  • 10. Shorthand Property You can use the font property to set all the font properties at once. For example − <html> <head> </head> <body> <p style = "font-stretch:ultra-expanded;"> If this doesn't appear to work, it is likely that your computer doesn't have a <br>condensed or expanded version of the font being used. </p> </body> </html>