SlideShare a Scribd company logo
Web Authoring

    Topic 17 –
Font Family in CSS
Objectives
Students should able to:
1   Explain the font families in CSS.
2   Explain the CSS Box Model
3   Explain the properties that make up the
    box: padding, border, margin,
         background colour
4   Perform CSS positioning and alignment
5   Format a table in CSS.
Font Family in CSS
The most common way that Cascading Style
Sheets are used is to change the font of a
Web page or site.
CSS recognizes five font families:
          -   Serif
          -   Sans-serif
          -   Script
          -   Monospace
          -   Fantasy
Font Family in CSS
Each category has many different typefaces
that are a part of the family.
Types of Font
Sans-serif fonts should be the basis of your
Web content. They are easy to read online
and there are many that are common to
most computer operating systems.

Serif fonts are best used in print style
sheets because they make printouts much
easier to read.
Types of Font
Monospace fonts should be used when
the spacing of the content is important -
such as with pre-formatted text.

Another common use of monospace fonts
is to display code or other technical
details.
Types of Font
Script fonts are best used as signatures or
other locations where the look of cursive
handwriting is desired.

Fantasy fonts are best used for headings
and artistic text. However, they are the
least common of all the categories.
Font Style Property
Define the typeface using the font-family
style property.
Some possible style listings:
- sans-serif body copy
  body { font-family : Verdana, Geneva,
  Arial, Helvetica, sans-serif; }
- serif body copy for print
  body { font-family : "Times New Romanā€,
  Times, serif; }
Box Model
Margins, padding and borders (see next
page) are all part of what's known as the
Box Model.
The Box Model works like this: in the
middle you have the content area (let's say
an image), surrounding that you have the
padding, surrounding that you have the
border and surrounding that you have the
margin.
Box Model
It can be visually represented like this:




You do not have to use all of these, but it
can be helpful to remember that the box
model can be applied to every element on
the page.
Text Align
The CSS text-align property is used for
aligning elements left, right, center etc.
Syntax : text-align: <value>
Example:
         td { text-align: right }
Text Align
<style type="text/css">
div {
 text-align: right;
}
</style>
<div>This div has been aligned using the
css text-align property. Try changing the
values to see the effect.
</div>
Text Position
The CSS positioning properties allow you to
position an element.
Elements can be positioned using the top,
bottom, left, and right properties.
Static Position
Static Positioning
HTML elements are positioned static by
default. A static positioned element is always
positioned according to the normal flow of
the page.
Static positioned elements are not affected
by the top, bottom, left, and right properties.
Fixed Position
Fixed Positioning
An element with fixed position is positioned
relative to the browser window.
It will not move even if the window is
scrolled.
Relative Position
Relative Positioning
A relative positioned element is positioned
relative to its normal position.
Absolute Position
Absolute Positioning
An absolute position element is positioned
relative to the first parent element that has a
position other than static. If no such element
is found, the containing block is <html>.
Format Table
In the example below, the table is named as
table1.

.table1 {width:200px;
        margin:auto;
        font-size:12px;
        border:1px solid #000000; }
Format Table
Formatting each TD cell in the table using a
bold blue colored font and applied a border
to each cell and text centered vertically and
left aligned horizontally.
.table1 td {font-weight:bold;
           color:#000099;
           vertical-align:middle; text-align:left;
           border:1px solid #000000; }
Add Background to Table
Add the following to the appropriate class:
background:#ccccff;

.table1 td { background:#ccccff;
            font-weight:bold;
            color:#000099;
           vertical-align:middle; text-align:left;
           border:1px solid #000000; }

More Related Content

What's hot (18)

PPTX
Cascading Style Sheet
KushagraChadha1
Ā 
PPSX
Introduction to css
Evolution Network
Ā 
PPTX
Responsive web design with html5 and css3
Divya Tiwari
Ā 
PPT
Cascading style sheet (css)]
9574395990
Ā 
PPTX
1 03 - CSS Introduction
apnwebdev
Ā 
PPTX
Css
shanmuga rajan
Ā 
PPTX
Cascading style sheets (CSS)
Harshita Yadav
Ā 
PPT
7.2 external style sheets
Bulldogs83
Ā 
PDF
cascadingstylesheets
tutorialsruby
Ā 
PPTX
Week 12 CSS - Review from last week
Katherine McCurdy-Lapierre, R.G.D.
Ā 
PPT
Cascading Style Sheet | CSS
MSA Technosoft
Ā 
PPTX
CSS - Text Properties
hstryk
Ā 
PPT
CSS
seedinteractive
Ā 
PDF
Html css
kanakaiah kedam
Ā 
PPTX
Week11 Lecture: CSS
Katherine McCurdy-Lapierre, R.G.D.
Ā 
PDF
Introduction to css
eShikshak
Ā 
PPT
CSS
venkatachalam84
Ā 
PPTX
CSS introduction
CloudTechĀ 
Ā 
Cascading Style Sheet
KushagraChadha1
Ā 
Introduction to css
Evolution Network
Ā 
Responsive web design with html5 and css3
Divya Tiwari
Ā 
Cascading style sheet (css)]
9574395990
Ā 
1 03 - CSS Introduction
apnwebdev
Ā 
Cascading style sheets (CSS)
Harshita Yadav
Ā 
7.2 external style sheets
Bulldogs83
Ā 
cascadingstylesheets
tutorialsruby
Ā 
Week 12 CSS - Review from last week
Katherine McCurdy-Lapierre, R.G.D.
Ā 
Cascading Style Sheet | CSS
MSA Technosoft
Ā 
CSS - Text Properties
hstryk
Ā 
Html css
kanakaiah kedam
Ā 
Week11 Lecture: CSS
Katherine McCurdy-Lapierre, R.G.D.
Ā 
Introduction to css
eShikshak
Ā 
CSS introduction
CloudTechĀ 
Ā 

Viewers also liked (20)

PPTX
Web topic 16 css workflow
CK Yang
Ā 
PPTX
Web topic 22 validation on web forms
CK Yang
Ā 
PPTX
Web topic 21 pass info via javascript
CK Yang
Ā 
PPTX
Web topic 20 1 html forms
CK Yang
Ā 
PPTX
Web topic 15 2 basic css layout
CK Yang
Ā 
PPTX
Web topic 20 2 html forms
CK Yang
Ā 
PPTX
Web topic 23 web accessibility
CK Yang
Ā 
PPTX
Web topic 29 w3 c page validation
CK Yang
Ā 
PPTX
Web topic 15 1 basic css layout
CK Yang
Ā 
PPTX
Web topic 25 mobile optimized website
CK Yang
Ā 
PPTX
Web topic 28. w3 c standards and guidelines
CK Yang
Ā 
PPTX
Web topic 32 validate web contents
CK Yang
Ā 
PPTX
Web topic 14 cascading style sheets
CK Yang
Ā 
PPTX
Web topic 24 usage of web browser
CK Yang
Ā 
PPTX
Web topic 30 ensure web contents meet
CK Yang
Ā 
PPTX
Web topic 29 w3 c page validation
CK Yang
Ā 
PPTX
Web topic 26 browser compatibilty and security
CK Yang
Ā 
PPTX
Web topic 33 publish websites
CK Yang
Ā 
PPTX
Web topic 31 setup remote site
CK Yang
Ā 
PPTX
Web topic 27 class test
CK Yang
Ā 
Web topic 16 css workflow
CK Yang
Ā 
Web topic 22 validation on web forms
CK Yang
Ā 
Web topic 21 pass info via javascript
CK Yang
Ā 
Web topic 20 1 html forms
CK Yang
Ā 
Web topic 15 2 basic css layout
CK Yang
Ā 
Web topic 20 2 html forms
CK Yang
Ā 
Web topic 23 web accessibility
CK Yang
Ā 
Web topic 29 w3 c page validation
CK Yang
Ā 
Web topic 15 1 basic css layout
CK Yang
Ā 
Web topic 25 mobile optimized website
CK Yang
Ā 
Web topic 28. w3 c standards and guidelines
CK Yang
Ā 
Web topic 32 validate web contents
CK Yang
Ā 
Web topic 14 cascading style sheets
CK Yang
Ā 
Web topic 24 usage of web browser
CK Yang
Ā 
Web topic 30 ensure web contents meet
CK Yang
Ā 
Web topic 29 w3 c page validation
CK Yang
Ā 
Web topic 26 browser compatibilty and security
CK Yang
Ā 
Web topic 33 publish websites
CK Yang
Ā 
Web topic 31 setup remote site
CK Yang
Ā 
Web topic 27 class test
CK Yang
Ā 
Ad

Similar to Web topic 17 font family in css (20)

PPT
CSS Basic and Common Errors
Hock Leng PUAH
Ā 
PPTX
CSS3 notes
Rex Wang
Ā 
PPTX
Css Complete Notes
EPAM Systems
Ā 
PDF
Web Design Course: CSS lecture 3
Gheyath M. Othman
Ā 
PDF
Introduction to CSS3
Seble Nigussie
Ā 
PPTX
CSS
DivyaKS12
Ā 
PPT
Basics Of Css And Some Common Mistakes
sanjay2211
Ā 
PPT
CSS
ARJUN
Ā 
PDF
Css from scratch
Ahmad Al-ammar
Ā 
PDF
Css
actacademy
Ā 
DOCX
Css
actacademy
Ā 
PDF
Pemrograman Web 3 - CSS Basic Part 2
Nur Fadli Utomo
Ā 
PPTX
CSS Presentation Notes.pptx
VineetaSingh713208
Ā 
ODP
Css jon duckett - flashcards
Chirag Aggarwal
Ā 
PPT
Css
Kavi Bharathi R
Ā 
PPT
Basic css
Gopinath Ambothi
Ā 
PPT
Css Founder.com | Cssfounder in
Css Founder
Ā 
CSS Basic and Common Errors
Hock Leng PUAH
Ā 
CSS3 notes
Rex Wang
Ā 
Css Complete Notes
EPAM Systems
Ā 
Web Design Course: CSS lecture 3
Gheyath M. Othman
Ā 
Introduction to CSS3
Seble Nigussie
Ā 
CSS
DivyaKS12
Ā 
Basics Of Css And Some Common Mistakes
sanjay2211
Ā 
CSS
ARJUN
Ā 
Css from scratch
Ahmad Al-ammar
Ā 
Css
actacademy
Ā 
Css
actacademy
Ā 
Pemrograman Web 3 - CSS Basic Part 2
Nur Fadli Utomo
Ā 
CSS Presentation Notes.pptx
VineetaSingh713208
Ā 
Css jon duckett - flashcards
Chirag Aggarwal
Ā 
Basic css
Gopinath Ambothi
Ā 
Css Founder.com | Cssfounder in
Css Founder
Ā 
Ad

More from CK Yang (9)

PPTX
Web topic 13 html validation tools
CK Yang
Ā 
PPTX
Web topic 12 tables in html
CK Yang
Ā 
PPTX
Web topic 11 importance of html validation
CK Yang
Ā 
PPTX
Web topic 10 2 web design basics
CK Yang
Ā 
PPTX
Web topic 9 navigation and link
CK Yang
Ā 
PPTX
Web topic 8 listings in html
CK Yang
Ā 
PPTX
Web topic 7 html tags for links
CK Yang
Ā 
PPTX
Web topic 5 text formatting
CK Yang
Ā 
PPTX
Web topic 4 style in html
CK Yang
Ā 
Web topic 13 html validation tools
CK Yang
Ā 
Web topic 12 tables in html
CK Yang
Ā 
Web topic 11 importance of html validation
CK Yang
Ā 
Web topic 10 2 web design basics
CK Yang
Ā 
Web topic 9 navigation and link
CK Yang
Ā 
Web topic 8 listings in html
CK Yang
Ā 
Web topic 7 html tags for links
CK Yang
Ā 
Web topic 5 text formatting
CK Yang
Ā 
Web topic 4 style in html
CK Yang
Ā 

Recently uploaded (20)

PPTX
Essential Content-centric Plugins for your Website
Laura Byrne
Ā 
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
Ā 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
Ā 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
Ā 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
Ā 
PDF
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
Ā 
PDF
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
Ā 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
Ā 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
Ā 
PDF
Kit-Works Team Study_20250627_ķ•œė‹¬ė§Œģ—ė§Œė“ ģ‚¬ė‚“ģ„œė¹„ģŠ¤ķ‚¤ė§(ģ–‘ė‹¤ģœ—).pdf
Wonjun Hwang
Ā 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
Ā 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
Ā 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
Ā 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
Ā 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
Ā 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
Ā 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
Ā 
PDF
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
Ā 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
Ā 
PPTX
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
Ā 
Essential Content-centric Plugins for your Website
Laura Byrne
Ā 
Wondershare Filmora Crack Free Download 2025
josanj305
Ā 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
Ā 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
Ā 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
Ā 
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
Ā 
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
Ā 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
Ā 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
Ā 
Kit-Works Team Study_20250627_ķ•œė‹¬ė§Œģ—ė§Œė“ ģ‚¬ė‚“ģ„œė¹„ģŠ¤ķ‚¤ė§(ģ–‘ė‹¤ģœ—).pdf
Wonjun Hwang
Ā 
How do you fast track Agentic automation use cases discovery?
DianaGray10
Ā 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
Ā 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
Ā 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
Ā 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
Ā 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
Ā 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
Ā 
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
Ā 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
Ā 
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
Ā 

Web topic 17 font family in css

  • 1. Web Authoring Topic 17 – Font Family in CSS
  • 2. Objectives Students should able to: 1 Explain the font families in CSS. 2 Explain the CSS Box Model 3 Explain the properties that make up the box: padding, border, margin, background colour 4 Perform CSS positioning and alignment 5 Format a table in CSS.
  • 3. Font Family in CSS The most common way that Cascading Style Sheets are used is to change the font of a Web page or site. CSS recognizes five font families: - Serif - Sans-serif - Script - Monospace - Fantasy
  • 4. Font Family in CSS Each category has many different typefaces that are a part of the family.
  • 5. Types of Font Sans-serif fonts should be the basis of your Web content. They are easy to read online and there are many that are common to most computer operating systems. Serif fonts are best used in print style sheets because they make printouts much easier to read.
  • 6. Types of Font Monospace fonts should be used when the spacing of the content is important - such as with pre-formatted text. Another common use of monospace fonts is to display code or other technical details.
  • 7. Types of Font Script fonts are best used as signatures or other locations where the look of cursive handwriting is desired. Fantasy fonts are best used for headings and artistic text. However, they are the least common of all the categories.
  • 8. Font Style Property Define the typeface using the font-family style property. Some possible style listings: - sans-serif body copy body { font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; } - serif body copy for print body { font-family : "Times New Romanā€, Times, serif; }
  • 9. Box Model Margins, padding and borders (see next page) are all part of what's known as the Box Model. The Box Model works like this: in the middle you have the content area (let's say an image), surrounding that you have the padding, surrounding that you have the border and surrounding that you have the margin.
  • 10. Box Model It can be visually represented like this: You do not have to use all of these, but it can be helpful to remember that the box model can be applied to every element on the page.
  • 11. Text Align The CSS text-align property is used for aligning elements left, right, center etc. Syntax : text-align: <value> Example: td { text-align: right }
  • 12. Text Align <style type="text/css"> div { text-align: right; } </style> <div>This div has been aligned using the css text-align property. Try changing the values to see the effect. </div>
  • 13. Text Position The CSS positioning properties allow you to position an element. Elements can be positioned using the top, bottom, left, and right properties.
  • 14. Static Position Static Positioning HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page. Static positioned elements are not affected by the top, bottom, left, and right properties.
  • 15. Fixed Position Fixed Positioning An element with fixed position is positioned relative to the browser window. It will not move even if the window is scrolled.
  • 16. Relative Position Relative Positioning A relative positioned element is positioned relative to its normal position.
  • 17. Absolute Position Absolute Positioning An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>.
  • 18. Format Table In the example below, the table is named as table1. .table1 {width:200px; margin:auto; font-size:12px; border:1px solid #000000; }
  • 19. Format Table Formatting each TD cell in the table using a bold blue colored font and applied a border to each cell and text centered vertically and left aligned horizontally. .table1 td {font-weight:bold; color:#000099; vertical-align:middle; text-align:left; border:1px solid #000000; }
  • 20. Add Background to Table Add the following to the appropriate class: background:#ccccff; .table1 td { background:#ccccff; font-weight:bold; color:#000099; vertical-align:middle; text-align:left; border:1px solid #000000; }