CSS Fonts. The Font properties allow you to change the font family, boldness, size, and the style of a text.

Slides:



Advertisements
Similar presentations
Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
Advertisements

Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
Week 7 Web Typography. 2 Understanding Type Design Principles.
Web Development & Design Foundations with HTML5
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
CSS – CASCADING STYLE SHEETS Making your XHTML webpage look good.
COS 125 DAY 17. Agenda  Assignment #5 Corrected 6 A’s, 2 B’s, 3 C’s 2 D’s, and 2 non-submits  Next Capstone Progress Report Due April 6  Exam #3 Graded.
1 CSS Styling with Fonts and Colors. 2 CSS Cascading Style Sheets and fonts CSS provides Style or Presentation options for our html pages CSS properties.
Cascading Style Sheets (CSS) Why do we need them? Separate structure from browser presentation There are many HTML presentation attributes –We want to.
1 Formatting: Is What You See What You Get? Gylphs and Fonts Document-Wide Style Changes Formatting List Items Formatting Different Tags Simultaneously.
Multimedia and the World Wide Web HCI 201 Lecture Notes #7B.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
CSS Properties on Parade PropertyValid valuesExample font-familylist of fonts (separate with commas, end with generic font: serif, sans-serif, fantasy,
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
CSS The Definitive Guide Chapter 5.  You will understand why setting font properties will be among the most common uses of style sheets.  Font family.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
Web Design – Sec 4-6 and 4-7 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
TECH2018 Multimedia and the Internet More about CSS and Page Layouts.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 09: Cascade Style Sheets - Spring 2011.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Principles of Web Design 6 th Edition Chapter 5 – Web Typography.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
Typography.  Introduction to Typography  Font Collections ▪ Serif ▪ They have small strokes at the end of the character strokes ▪ Ex: Times New Roman,
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
Class three: CSS review, backgrounds, font formatting, the box model.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
CSS Font CSS font properties define the font family, boldness, size, and the style of a text. CSS Font Families Generic family Font familyDescription Serif.
Cascading Style Sheets Class 2, Lecture 2 Rachel A Ober
Introduction to CSS CSS Fonts - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Font Control Instructor: Joseph DiVerdi, Ph.D.,
Text and Fonts in CSS. Customizing fonts In CSS, fonts are divided into “font families” Only certain fonts are commonly installed on most computers Therefore.
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Files you will need ... Black Goose Bistro Summer Menu
Fonts The following CSS properties will be described: 1.Font-family 2.Font-style 3.Font-variant 4.Font-weight 5.Font-size 6.Font.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
Advanced Web Development Instructor: Thomas Bombach.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
CSS Presentation CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity Svetlin Nakov Technical Trainer Software University
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
Today’s objectives Layouts | floats Measurement units Type properties
Developing Web Applications with HTML and CSS “Selectors and Properties”
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
Class & ID Selectors, Font and List Properties. Id Selectors  # followed by Id-name (without space)  Can be used once on a page  Examples: #p1 { color:
Basic Webpage Design Cascading Style Sheet (CSS).
Font-Family, Color and Background. Basics  CSS rule: Selector (multiple separated by, ) Declaration (multiple separated by ; ) Example: p { color: red;
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
Formatting Text with HTML and CSS. Summary block-level elements. Character-level elements Logical and physical style Special elements: hr,address, quotation.
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 10: Formatting Text with Styles.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
The Internet 10/11/11 Fonts and Colors
Applying Typography in CSS
CSS – Properties & Values
CMPE 280 Web UI Design and Development September 4 Class Meeting
CMPE 280 Web UI Design and Development February 7 Class Meeting
Lesson 5 Topic B – Basic Text & Fonts
Cascading Style Sheets
CMPE 280 Web UI Design and Development September 5 Class Meeting
Presentation transcript:

CSS Fonts

The Font properties allow you to change the font family, boldness, size, and the style of a text.

Notes - Useful Tips Fonts are identified by their name in CSS1. Note that if a browser does not support the font that is specified, it will use a default font.

The Font Property The font property is, with exception of some system fonts, a shorthand property for setting all of the properties for a font in one declaration. Note: This property also has a sixth value: "line-height", which sets the space between lines. Inherited: Yes

Example p { font: italic bolder } p { font: italic small-caps bold 12px arial } p { font: oblique small-caps px/14px arial } p { font: menu }

ValueDescriptionNNIE font-style font-variant Sets the properties for a font. 4.0 captionDefines the font that are used by captioned controls 4.0 iconDefines the fonts that are used by icon labels 4.0 menuDefines the fonts that are used by dropdown menus 4.0 message- box Defines the fonts that are used by dialog boxes caption status-barDefines the fonts that are used by window status bars

Browser Notes Note in Netscape 4.0+: The "font-variant" value in this declaration does not work

Font-Family Property The font-family property is a prioritized list of font family names and/or generic family names for an element. The browser will use the first value it recognizes.

There are two types of font-family values: family-name: The name of a font-family, like "times", "courier", "arial", etc. generic-family: The name of a generic- family, like "serif", "sans-serif", "cursive", "fantasy", "monospace".

Note: Separate each value with a comma, and always offer a generic-family name as the last alternative. Note: If a family-name contains white- space, it should be quoted. Single quotes must be used when using the "style" attribute in HTML. Inherited: Yes

Example body { font-family: courier, serif } p { font-family: arial, "lucida console", sans-serif }

Possible Values ValueDescriptionNNIE family-name generic-family A prioritized list of font family names and/or generic family names for an element

Browser Notes Notes in Netscape 4.0+: The "cursive" generic-family renders as "serif" The "fantasy" generic-family renders as "sans-serif"

Font-Size Property The font-size property sets the size of a font. Inherited: Yes

Example body { font-size: x-large } p { font-size: 10px }

Possible Values ValueDescriptionNNIE small medium large Sets the size of the font to different sizes, from xx-small to xx-large 4.0 smallerSets the font-size to a smaller size than the parent element 4.0 largerSets the font-size to a larger size than the parent element 4.0 lengthSets the font-size to a fixed size %Sets the font-size to a % of the parent element

Browser Notes Note in IE 4.0+: Default value of this property is "small", not "medium" as it should be according to the W3C specification Notes in Netscape 4.0+: Default value of this property is "small", not "medium" as it should be according to the W3C specification Do not use % values under 100%. It can change color of the text or make the text difficult to read

Font-Size-Adjust The ratio between the height of the font's lowercase letter "x" and the height of the "font-size" is called a font's aspect value. If the aspect value is high, the font will be legible when it is set to a smaller size. For example: Verdana has an aspect value of 0.58 (means that when font size is 100 px, its x-height is 58 px). Times New Roman has an aspect value of This means that Verdana is more legible at smaller sizes than Times New Roman. The font-size-adjust property specifies an aspect value for an element that will preserve the x-height of the first- choice font. Inherited: Yes

Example h2 { font-size-adjust: 0.58 }

Possible Values ValueDescriptionNNIE noneDo not preserve the font's x- height if the font is unavailable numberDefines the aspect value ratio for the font.

Font-Style Property The font-style property sets the style of a font. Inherited: Yes

Example body { font-style: italic }

Possible Values ValueDescriptionNNIE normalThe browser displays a normal font italicThe browser displays an italic font obliqueThe browser displays an oblique font 4.0

Font-Weight Property The font-weight property sets how thick or thin characters in text should be displayed. Inherited: Yes

Example p { font-weight: bold }

Possible Values ValueDescriptionNNIE normalDefines normal characters boldDefines thick characters bolderDefines thicker characters4.0 lighterDefines lighter characters4.0