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
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
 
PDF
Html css
kanakaiah kedam
 
PPTX
Week11 Lecture: CSS
Katherine McCurdy-Lapierre, R.G.D.
 
PDF
Introduction to css
eShikshak
 
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
 
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
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
 
Basics Of Css And Some Common Mistakes
sanjay2211
 
CSS
ARJUN
 
Css from scratch
Ahmad Al-ammar
 
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)

PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 

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; }