SlideShare a Scribd company logo
Styling Text With CSS
     Font & Text Properties
Applying Fonts
• Single Font Names:
  body {font-family: Verdana;}
• Font Family Keywords:
  body {font-family: serif;}
• Multiple Font Names:
  body
  {font-family: Arial, Helvetica,Verdana, san-serif;
  }
Sizing Fonts - Keywords
    Uses font-size property.
    Absolute Keywords
•   Browser computes the font size.
•   Available keywords: xx-small, x-small, small,
    medium, large, x-large, xx-large.
    Ex. body {font-size: small;}
Sizing Fonts - Keywords
    Absolute Keywords
•   Medium is browser default for font size.
•   Medium is equivalent to about 16 points.
•   Scaling factor of 1.5 between each keyword.
•   Scale remains constant irrespective of the
    physical size the text is rendered in.
Sizing Fonts - Keywords
    Relative Keywords
•   Only two possible values: larger and smaller.
•   Values are relative to the size of parent
    element.
      body {font-size: medium;}
      h1 {font-size: larger;}
    In the above example, h1's size will
    increase to the keyword large.
Sizing Fonts - Lengths
    Length Values
•   Can be either relative or absolute values.
•   Relative length values are:
    •   em: relative to the font-size of parent
        element.
    •   ex: relative to height of letter x in
        specified font.
    •   px: relative to the resolution of the device.
Sizing Fonts - Lengths
    Absolute Length Values
•   Useful primarily when creating print-version
    of web document.
•   Absolute length values are:
    •   inches (in)
    •   centimeters (cm)
    •   millimeters (mm)
Sizing Fonts - Percentages

•   Always used relative to keyword or length
    value.
      Ex:
      body {font-size: small;}
      h1 {font-size: 150%;}
Sizing Fonts - Techniques
•   Most common method is to combine
    percentages with either keywords or ems.
•   Set a base font size with the body tag, then
    increase/decrease text size as desired using
    percentages. (Recommended method).
•   Base font size of small is recommended
    (corresponds to about 12 px).
•   Avoid setting font size in pixels as IE does
    not scale pixels; users will not be able to
    increase or decrease font size.
Font Weight & Style
    Font Weight
•   How bold a font is (or not).
•   Uses font-weight property.
•    Can be set in numeric values from 100-900.
    • 100 - very light
    • 900 - darkest
    • 400 - normal
•    Can be set in keywords:
    • normal (corresponds to 400)
    • bold (equivalent to 700)
    • bolder and lighter
Font Weight & Style
Font Weight
Only use number values that correspond
directly to known weights:
   400 for normal
   700 for bold
 Ex:
       h1 {
       font-size: 150%;
       font-weight: bold;
       }
Font Weight & Style
     Font Styles
•    Uses font-style property; alters font face.
•    Values are:
      •   normal - default and typically does not need
          to be set.
      •   oblique - only applied when available on user
          computers.
      •   italic: most commonly used.
Ex
    h2 {font-size: 130%; font-style: italic;}
Aligning Text
•   Uses text-align property.
•   Values are:
     •   left - browser default.
     •   center - Useful for header, captions,
         etc. Not recommended for body text.
     •   right: most commonly used.
     •   justify: equal space on left and right
         sides, but spacing can be awkward.
Ex
h1 {text-align: center;}
Text Decoration
•   Uses text-decoration property.
•   Values are:
     •   none - primarily used to remove
         underlines from links in navigation.
     •   underline: underlines selected text.
     •   overline: places line above selected
         text.
     •   line-through: Strikethrough.
a {text-decoration: none;}
Line Height
•   Uses line-height property.
•   Sets spacing between lines in a section of
    text.
•   Can be set using length, percentage,
    number, or em.
•   Default line height for web pages is
    around 1.2 em.
     body {line-height: 1.5;}

More Related Content

Viewers also liked

Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSAmit Tyagi
 
BDD Short Introduction
BDD Short IntroductionBDD Short Introduction
BDD Short IntroductionAndreas Enbohm
 
CSS3 Transitions
CSS3 TransitionsCSS3 Transitions
CSS3 Transitionshstryk
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorialhstryk
 
1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgroundsapnwebdev
 
Backbone Conf 2014 - Realtime & Firebase
Backbone Conf 2014 - Realtime & FirebaseBackbone Conf 2014 - Realtime & Firebase
Backbone Conf 2014 - Realtime & FirebaseClément Wehrung
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Propertieshstryk
 
BEAUTIFUL CSS PRESENTATION EASY TO MADE
BEAUTIFUL CSS PRESENTATION EASY TO MADEBEAUTIFUL CSS PRESENTATION EASY TO MADE
BEAUTIFUL CSS PRESENTATION EASY TO MADErana usman
 
CSS Dasar #5 : Text Styling
CSS Dasar #5 : Text StylingCSS Dasar #5 : Text Styling
CSS Dasar #5 : Text StylingSandhika Galih
 
JavaScript/CSS 2015 Autumn
JavaScript/CSS 2015 AutumnJavaScript/CSS 2015 Autumn
JavaScript/CSS 2015 AutumnKoji Ishimoto
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing worldRuss Weakley
 
Sane CSS - A modern approach to CSS
Sane CSS - A modern approach to CSSSane CSS - A modern approach to CSS
Sane CSS - A modern approach to CSSLee Cheneler
 

Viewers also liked (20)

Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
BDD Short Introduction
BDD Short IntroductionBDD Short Introduction
BDD Short Introduction
 
CSS3 Transitions
CSS3 TransitionsCSS3 Transitions
CSS3 Transitions
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorial
 
Css text property
Css text propertyCss text property
Css text property
 
1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds
 
Backbone Conf 2014 - Realtime & Firebase
Backbone Conf 2014 - Realtime & FirebaseBackbone Conf 2014 - Realtime & Firebase
Backbone Conf 2014 - Realtime & Firebase
 
Asset Positioning for Performance
Asset Positioning for PerformanceAsset Positioning for Performance
Asset Positioning for Performance
 
Rebooting the Blue Button
Rebooting the Blue ButtonRebooting the Blue Button
Rebooting the Blue Button
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 
CSS Secrets - Lea Verou
CSS Secrets - Lea VerouCSS Secrets - Lea Verou
CSS Secrets - Lea Verou
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
 
Js: master prototypes
Js: master prototypesJs: master prototypes
Js: master prototypes
 
CSS Reset
CSS ResetCSS Reset
CSS Reset
 
Javascript: master this
Javascript: master thisJavascript: master this
Javascript: master this
 
BEAUTIFUL CSS PRESENTATION EASY TO MADE
BEAUTIFUL CSS PRESENTATION EASY TO MADEBEAUTIFUL CSS PRESENTATION EASY TO MADE
BEAUTIFUL CSS PRESENTATION EASY TO MADE
 
CSS Dasar #5 : Text Styling
CSS Dasar #5 : Text StylingCSS Dasar #5 : Text Styling
CSS Dasar #5 : Text Styling
 
JavaScript/CSS 2015 Autumn
JavaScript/CSS 2015 AutumnJavaScript/CSS 2015 Autumn
JavaScript/CSS 2015 Autumn
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing world
 
Sane CSS - A modern approach to CSS
Sane CSS - A modern approach to CSSSane CSS - A modern approach to CSS
Sane CSS - A modern approach to CSS
 

Similar to Styling Text With CSS

Similar to Styling Text With CSS (20)

Fonts
FontsFonts
Fonts
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10
 
Css1 properties
Css1 propertiesCss1 properties
Css1 properties
 
Btk creative-web-03
Btk creative-web-03Btk creative-web-03
Btk creative-web-03
 
Typography On The Web
Typography On The WebTypography On The Web
Typography On The Web
 
Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2
 
Lecture 12 css_fonts
Lecture 12 css_fontsLecture 12 css_fonts
Lecture 12 css_fonts
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete Notes
 
Line Height
Line HeightLine Height
Line Height
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
CSS LINE HEIGHT
CSS LINE HEIGHTCSS LINE HEIGHT
CSS LINE HEIGHT
 
8 Typography Notes
8 Typography Notes8 Typography Notes
8 Typography Notes
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
 
CSS INHERITANCE
CSS INHERITANCECSS INHERITANCE
CSS INHERITANCE
 
Ppt ch05
Ppt ch05Ppt ch05
Ppt ch05
 
Responsive Web Design & Typography
Responsive Web Design & TypographyResponsive Web Design & Typography
Responsive Web Design & Typography
 
Css font properties
Css font propertiesCss font properties
Css font properties
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
Typography For The Web
Typography For The WebTypography For The Web
Typography For The Web
 

More from Vidya Ananthanarayanan

More from Vidya Ananthanarayanan (7)

Social Media For Non-Profits & Educators
Social Media For Non-Profits & EducatorsSocial Media For Non-Profits & Educators
Social Media For Non-Profits & Educators
 
Microblogging
MicrobloggingMicroblogging
Microblogging
 
SEO: A Web Design Perspective
SEO: A Web Design PerspectiveSEO: A Web Design Perspective
SEO: A Web Design Perspective
 
CSS - Styling Links and Creating Navigation
CSS - Styling Links and Creating NavigationCSS - Styling Links and Creating Navigation
CSS - Styling Links and Creating Navigation
 
CSS - Adding Background Images
CSS - Adding Background ImagesCSS - Adding Background Images
CSS - Adding Background Images
 
Box Model and Page Layouts
Box Model and Page LayoutsBox Model and Page Layouts
Box Model and Page Layouts
 
An Introduction to CSS
An Introduction to CSSAn Introduction to CSS
An Introduction to CSS
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...Elena Simperl
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Product School
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 

Styling Text With CSS

  • 1. Styling Text With CSS Font & Text Properties
  • 2. Applying Fonts • Single Font Names: body {font-family: Verdana;} • Font Family Keywords: body {font-family: serif;} • Multiple Font Names: body {font-family: Arial, Helvetica,Verdana, san-serif; }
  • 3. Sizing Fonts - Keywords Uses font-size property. Absolute Keywords • Browser computes the font size. • Available keywords: xx-small, x-small, small, medium, large, x-large, xx-large. Ex. body {font-size: small;}
  • 4. Sizing Fonts - Keywords Absolute Keywords • Medium is browser default for font size. • Medium is equivalent to about 16 points. • Scaling factor of 1.5 between each keyword. • Scale remains constant irrespective of the physical size the text is rendered in.
  • 5. Sizing Fonts - Keywords Relative Keywords • Only two possible values: larger and smaller. • Values are relative to the size of parent element. body {font-size: medium;} h1 {font-size: larger;} In the above example, h1's size will increase to the keyword large.
  • 6. Sizing Fonts - Lengths Length Values • Can be either relative or absolute values. • Relative length values are: • em: relative to the font-size of parent element. • ex: relative to height of letter x in specified font. • px: relative to the resolution of the device.
  • 7. Sizing Fonts - Lengths Absolute Length Values • Useful primarily when creating print-version of web document. • Absolute length values are: • inches (in) • centimeters (cm) • millimeters (mm)
  • 8. Sizing Fonts - Percentages • Always used relative to keyword or length value. Ex: body {font-size: small;} h1 {font-size: 150%;}
  • 9. Sizing Fonts - Techniques • Most common method is to combine percentages with either keywords or ems. • Set a base font size with the body tag, then increase/decrease text size as desired using percentages. (Recommended method). • Base font size of small is recommended (corresponds to about 12 px). • Avoid setting font size in pixels as IE does not scale pixels; users will not be able to increase or decrease font size.
  • 10. Font Weight & Style Font Weight • How bold a font is (or not). • Uses font-weight property. • Can be set in numeric values from 100-900. • 100 - very light • 900 - darkest • 400 - normal • Can be set in keywords: • normal (corresponds to 400) • bold (equivalent to 700) • bolder and lighter
  • 11. Font Weight & Style Font Weight Only use number values that correspond directly to known weights: 400 for normal 700 for bold Ex: h1 { font-size: 150%; font-weight: bold; }
  • 12. Font Weight & Style Font Styles • Uses font-style property; alters font face. • Values are: • normal - default and typically does not need to be set. • oblique - only applied when available on user computers. • italic: most commonly used. Ex h2 {font-size: 130%; font-style: italic;}
  • 13. Aligning Text • Uses text-align property. • Values are: • left - browser default. • center - Useful for header, captions, etc. Not recommended for body text. • right: most commonly used. • justify: equal space on left and right sides, but spacing can be awkward. Ex h1 {text-align: center;}
  • 14. Text Decoration • Uses text-decoration property. • Values are: • none - primarily used to remove underlines from links in navigation. • underline: underlines selected text. • overline: places line above selected text. • line-through: Strikethrough. a {text-decoration: none;}
  • 15. Line Height • Uses line-height property. • Sets spacing between lines in a section of text. • Can be set using length, percentage, number, or em. • Default line height for web pages is around 1.2 em. body {line-height: 1.5;}