SlideShare a Scribd company logo
Font 
322432 Web Design Technology 
By Yaowaluck Promdee, Sumonta Kasemvilas 
CSS & HTML 
322432-1/2014
Index 
• Unit Style Sheet 
• CSS - Fonts 
• Example 
• Assignment 
322432-1/2014
Unit Style Sheet 
Relative Length 
• em – font size of element 
• ex- height of element’s font 
• percent- consists of a number 
immediately followed by percent 
sign ‘%’ 
322432-1/2014
Unit Style Sheet (Cont.) 
Absolute Length 
• in (inches; 1in=2.54cm =72pt =6pc) 
Ex. 2in, 1.5in 
• cm (centimeters; 1cm=10mm) Ex. 2cm, 1.11cm 
• mm (millimeters) Ex. 50mm, 0.8mm 
• pt (points; 1pt=1/72in, 10pt = 12px) Ex.12pt, 20pt 
• pc (picas; 1pc=12pt) Ex. 1pc, 2pc 
• pixel (px) : pixel 1px is equal to 1/96th of 1in 
322432-1/2014
322432-1/2014 
Example 
h1 { line-height: 1.2em } 
h1 { font-size: 1.2em } 
h1 { margin: 0.5in } /* inches */ 
h2 { line-height: 3cm } /* centimeters */ 
h3 { word-spacing: 4mm } /* millimeters */ 
h4 { font-size: 12pt } /* points */ 
h4 { font-size: 1pc } /* picas */ 
p { font-size: 12px } /* px */
322432-1/2014
CSS-Font 
Property Description Values 
font-family Specifies the font family 
322432-1/2014 
for text 
Ex. Arial, Helvetica, 
sans-serif 
font-size Specifies the font size of 
text 
xx-small, x-small, small, 
medium, large, x-large, 
xx-large, smaller, larger, 
18px, 70%, 150%
CSS-Font 
Property Description Values 
font-style The font-style property is mostly 
used to specify italic text. 
322432-1/2014 
normal 
italic 
oblique 
font-variant In a small-caps font, all 
lowercase letters are converted 
to uppercase letters. 
normal 
Small-Caps 
font-weight The font-weight property sets 
how thick or thin characters in 
text should be displayed. 
normal 
bold 
bolder 
lighter 
100 
200
Example1 
322432-1/2014 
p { 
font-family:Arial; 
font-size:16pt; 
color:green 
} 
p.ex { font:15px sans-serif red; 
/*not specified */ }
Example2 
322432-1/2014 
How you code? 
<p style="font-weight:bold">Love me Love my dog</p> 
<p style="font: normal small-caps bold 16px sans-serif, Arial; 
color:#FF0033">Love me Love my dog</p>
Difference Between Serif and Sans-serif Fonts 
322432-1/2014
Text 
Property Description Values 
color The color property is used to set 
the color of the text 
322432-1/2014 
- a HEX value - like 
"#ff0000" 
- an RGB value - like 
"rgb(255,0,0)" 
- a color name - like "red" 
direction The direction property specifies the 
text direction/writing direction 
direction: ltr|rtl|initial|inherit; 
line-height The line-height property specifies 
the line height. 
line-height: 
normal|number|length|initial| 
inherit; 
letter-spacing The letter-spacing property 
increases or decreases the space 
between characters in a text. 
letter-spacing: 
normal|length|initial|inherit; 
text-align The text-align property specifies the 
horizontal alignment of text in an 
element. 
text-align: 
left|right|center|justify|initial|i 
nherit; 
http://www.w3schools.com/
Text 
Property Description Values 
text-decoration The text-decoration property 
specifies the decoration added to 
text. 
322432-1/2014 
text-decoration: 
none|underline| overline| 
line-through|initial|inherit; 
text-indent The text-indent property specifies 
the indentation of the first line in a 
text-block. 
text-indent: length |initial 
|inherit; 
text-transform The text-transform property 
controls the capitalization of text 
None | capitalize | 
uppercase | lowercase | 
initial | inherit 
white-space The white-space property 
specifies how white-space inside 
an element is handled. 
Normal | nowrap | pre | pre-line 
| pre-wrap | initial | 
inherit 
word-spacing The word-spacing property 
increases or decreases the white 
space between words. 
word-spacing: normal | 
length | initial | inherit 
http://www.w3schools.com/
Example 
<html> 
<head> 
<style type="text/css"> 
.p1 { 
color:#FF0033; 
line-height:18pt; 
letter-spacing:0.05cm; 
text-decoration:overline; 
text-indent:0.5in; 
text-transform:capitalize; 
white-space:normal; 
word-spacing:0.5em; 
} 
</style> 
</head> 
<body> 
<p class="p1">good moring teacher, how are you today?</p> 
</body> 
</html>
Example
Assignment#6 Fonts 
Create a Web page to present “CSS-Font design” 
from information provided using 
CSS font and text 
“CSS-Font design” 
รูปแบบการส่งงาน 
Grade will be based on your CSS technique and look and 
feel of the Web page. 
**กรณีมีรูปภาพหรือกราฟิกอื่นให้ใส่มาใน folder งานด้วย โดยไม่ต้อง zip ไม่งัน้รูปภาพหรือกราฟฟิกจะ 
ไม่แสดง**

More Related Content

Similar to Lab#6 font css html

CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
Yaowaluck Promdee
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Seble Nigussie
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
Nosheen Qamar
 
IT2255 Web Essentials - Unit II Web Designing
IT2255 Web Essentials - Unit II  Web DesigningIT2255 Web Essentials - Unit II  Web Designing
IT2255 Web Essentials - Unit II Web Designing
pkaviya
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
Mukesh Kumar
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
Gheyath M. Othman
 
Css
CssCss
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptx
MarwaAnany1
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
Himanshu Pathak
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
Umesh Agarwal
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraft
imrokraft
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete Notes
EPAM Systems
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSLarry King
 
Css
CssCss
Css
CssCss
css.pdf
css.pdfcss.pdf
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
Timbal Mayank
 
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
CascadingStyleSheets  in ONESHOT By DeathCodeYT .pdfCascadingStyleSheets  in ONESHOT By DeathCodeYT .pdf
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
balbirnainnain496
 
Html text and formatting
Html text and formattingHtml text and formatting
Html text and formattingeShikshak
 

Similar to Lab#6 font css html (20)

CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
 
IT2255 Web Essentials - Unit II Web Designing
IT2255 Web Essentials - Unit II  Web DesigningIT2255 Web Essentials - Unit II  Web Designing
IT2255 Web Essentials - Unit II Web Designing
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
 
Css
CssCss
Css
 
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptx
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraft
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete Notes
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Css
CssCss
Css
 
Css
CssCss
Css
 
css.pdf
css.pdfcss.pdf
css.pdf
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
 
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
CascadingStyleSheets  in ONESHOT By DeathCodeYT .pdfCascadingStyleSheets  in ONESHOT By DeathCodeYT .pdf
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
 
Html text and formatting
Html text and formattingHtml text and formatting
Html text and formatting
 

More from Yaowaluck Promdee

A basic of UX for beginner
A basic of UX for beginnerA basic of UX for beginner
A basic of UX for beginner
Yaowaluck Promdee
 
TCAS 2563
TCAS 2563TCAS 2563
Portfolio design
Portfolio designPortfolio design
Portfolio design
Yaowaluck Promdee
 
Concept to creation story and storyboard
Concept to creation  story and storyboard Concept to creation  story and storyboard
Concept to creation story and storyboard
Yaowaluck Promdee
 
Observation and interviewing
Observation and interviewingObservation and interviewing
Observation and interviewing
Yaowaluck Promdee
 
Requirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvasRequirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvas
Yaowaluck Promdee
 
Good bad design
Good bad designGood bad design
Good bad design
Yaowaluck Promdee
 
Bootstrap Framework
Bootstrap Framework Bootstrap Framework
Bootstrap Framework
Yaowaluck Promdee
 
Tables and forms with HTML, CSS
Tables and forms with HTML, CSS  Tables and forms with HTML, CSS
Tables and forms with HTML, CSS
Yaowaluck Promdee
 
Navigation and Link
Navigation and LinkNavigation and Link
Navigation and Link
Yaowaluck Promdee
 
Graphic, Color and tools
Graphic, Color and toolsGraphic, Color and tools
Graphic, Color and tools
Yaowaluck Promdee
 
Page layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSSPage layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSS
Yaowaluck Promdee
 
CSS Boc model
CSS Boc model CSS Boc model
CSS Boc model
Yaowaluck Promdee
 
Style and Selector Part2
Style and Selector Part2Style and Selector Part2
Style and Selector Part2
Yaowaluck Promdee
 
Style and Selector
Style and SelectorStyle and Selector
Style and Selector
Yaowaluck Promdee
 
Design sitemap
Design sitemapDesign sitemap
Design sitemap
Yaowaluck Promdee
 
Good/Bad Web Design
Good/Bad Web DesignGood/Bad Web Design
Good/Bad Web Design
Yaowaluck Promdee
 
HTML 5
HTML 5HTML 5
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
Yaowaluck Promdee
 
Web Interface
Web InterfaceWeb Interface
Web Interface
Yaowaluck Promdee
 

More from Yaowaluck Promdee (20)

A basic of UX for beginner
A basic of UX for beginnerA basic of UX for beginner
A basic of UX for beginner
 
TCAS 2563
TCAS 2563TCAS 2563
TCAS 2563
 
Portfolio design
Portfolio designPortfolio design
Portfolio design
 
Concept to creation story and storyboard
Concept to creation  story and storyboard Concept to creation  story and storyboard
Concept to creation story and storyboard
 
Observation and interviewing
Observation and interviewingObservation and interviewing
Observation and interviewing
 
Requirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvasRequirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvas
 
Good bad design
Good bad designGood bad design
Good bad design
 
Bootstrap Framework
Bootstrap Framework Bootstrap Framework
Bootstrap Framework
 
Tables and forms with HTML, CSS
Tables and forms with HTML, CSS  Tables and forms with HTML, CSS
Tables and forms with HTML, CSS
 
Navigation and Link
Navigation and LinkNavigation and Link
Navigation and Link
 
Graphic, Color and tools
Graphic, Color and toolsGraphic, Color and tools
Graphic, Color and tools
 
Page layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSSPage layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSS
 
CSS Boc model
CSS Boc model CSS Boc model
CSS Boc model
 
Style and Selector Part2
Style and Selector Part2Style and Selector Part2
Style and Selector Part2
 
Style and Selector
Style and SelectorStyle and Selector
Style and Selector
 
Design sitemap
Design sitemapDesign sitemap
Design sitemap
 
Good/Bad Web Design
Good/Bad Web DesignGood/Bad Web Design
Good/Bad Web Design
 
HTML 5
HTML 5HTML 5
HTML 5
 
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
 
Web Interface
Web InterfaceWeb Interface
Web Interface
 

Recently uploaded

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 

Recently uploaded (20)

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 

Lab#6 font css html

  • 1. Font 322432 Web Design Technology By Yaowaluck Promdee, Sumonta Kasemvilas CSS & HTML 322432-1/2014
  • 2. Index • Unit Style Sheet • CSS - Fonts • Example • Assignment 322432-1/2014
  • 3. Unit Style Sheet Relative Length • em – font size of element • ex- height of element’s font • percent- consists of a number immediately followed by percent sign ‘%’ 322432-1/2014
  • 4. Unit Style Sheet (Cont.) Absolute Length • in (inches; 1in=2.54cm =72pt =6pc) Ex. 2in, 1.5in • cm (centimeters; 1cm=10mm) Ex. 2cm, 1.11cm • mm (millimeters) Ex. 50mm, 0.8mm • pt (points; 1pt=1/72in, 10pt = 12px) Ex.12pt, 20pt • pc (picas; 1pc=12pt) Ex. 1pc, 2pc • pixel (px) : pixel 1px is equal to 1/96th of 1in 322432-1/2014
  • 5. 322432-1/2014 Example h1 { line-height: 1.2em } h1 { font-size: 1.2em } h1 { margin: 0.5in } /* inches */ h2 { line-height: 3cm } /* centimeters */ h3 { word-spacing: 4mm } /* millimeters */ h4 { font-size: 12pt } /* points */ h4 { font-size: 1pc } /* picas */ p { font-size: 12px } /* px */
  • 7. CSS-Font Property Description Values font-family Specifies the font family 322432-1/2014 for text Ex. Arial, Helvetica, sans-serif font-size Specifies the font size of text xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, 18px, 70%, 150%
  • 8. CSS-Font Property Description Values font-style The font-style property is mostly used to specify italic text. 322432-1/2014 normal italic oblique font-variant In a small-caps font, all lowercase letters are converted to uppercase letters. normal Small-Caps font-weight The font-weight property sets how thick or thin characters in text should be displayed. normal bold bolder lighter 100 200
  • 9. Example1 322432-1/2014 p { font-family:Arial; font-size:16pt; color:green } p.ex { font:15px sans-serif red; /*not specified */ }
  • 10. Example2 322432-1/2014 How you code? <p style="font-weight:bold">Love me Love my dog</p> <p style="font: normal small-caps bold 16px sans-serif, Arial; color:#FF0033">Love me Love my dog</p>
  • 11. Difference Between Serif and Sans-serif Fonts 322432-1/2014
  • 12. Text Property Description Values color The color property is used to set the color of the text 322432-1/2014 - a HEX value - like "#ff0000" - an RGB value - like "rgb(255,0,0)" - a color name - like "red" direction The direction property specifies the text direction/writing direction direction: ltr|rtl|initial|inherit; line-height The line-height property specifies the line height. line-height: normal|number|length|initial| inherit; letter-spacing The letter-spacing property increases or decreases the space between characters in a text. letter-spacing: normal|length|initial|inherit; text-align The text-align property specifies the horizontal alignment of text in an element. text-align: left|right|center|justify|initial|i nherit; http://www.w3schools.com/
  • 13. Text Property Description Values text-decoration The text-decoration property specifies the decoration added to text. 322432-1/2014 text-decoration: none|underline| overline| line-through|initial|inherit; text-indent The text-indent property specifies the indentation of the first line in a text-block. text-indent: length |initial |inherit; text-transform The text-transform property controls the capitalization of text None | capitalize | uppercase | lowercase | initial | inherit white-space The white-space property specifies how white-space inside an element is handled. Normal | nowrap | pre | pre-line | pre-wrap | initial | inherit word-spacing The word-spacing property increases or decreases the white space between words. word-spacing: normal | length | initial | inherit http://www.w3schools.com/
  • 14. Example <html> <head> <style type="text/css"> .p1 { color:#FF0033; line-height:18pt; letter-spacing:0.05cm; text-decoration:overline; text-indent:0.5in; text-transform:capitalize; white-space:normal; word-spacing:0.5em; } </style> </head> <body> <p class="p1">good moring teacher, how are you today?</p> </body> </html>
  • 15.
  • 17. Assignment#6 Fonts Create a Web page to present “CSS-Font design” from information provided using CSS font and text “CSS-Font design” รูปแบบการส่งงาน Grade will be based on your CSS technique and look and feel of the Web page. **กรณีมีรูปภาพหรือกราฟิกอื่นให้ใส่มาใน folder งานด้วย โดยไม่ต้อง zip ไม่งัน้รูปภาพหรือกราฟฟิกจะ ไม่แสดง**

Editor's Notes

  1. h1 { line-height: 1.2em } means that the line height of h1 elements will be 20% greater than the font size of h1 element. On the other hand: h1 { font-size: 1.2em } means that the font size of h1 elements will be 20% greater than the computed font size inherited by h1 elements.
  2. This property has three values: normal - The text is shown normally italic - The text is shown in italics oblique - The text is "leaning" (oblique is very similar to italic, but less supported)
  3. Normal - A normal line height. This is default Number - A number that will be multiplied with the current font size to set the line height Length - A fixed line height in px, pt, cm, etc. % - A line height in percent of the current font size Initial - Sets this property to its default value. Inherit - Inherits this property from its parent element.
  4. จากเนื้อหาที่ให้มา ให้นักศึกษา นำเนื้อหาไปจัดวางออกแบบโดยใช้ CSS Font text ในการจัดรูปแบบการนำเสนอ เนื้อหาที่ยกมาให้