Let’s do it with Style! Fonts, Colors, and Graphics CSCI 202 Day 1 (Fall 2014) Font/Colors CS 202 1.

Slides:



Advertisements
Similar presentations
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Advertisements

Part 3 Introduction to CSS. CSS Text Text Styles h1 {color: green} // rgb(0,255,0), #00ff00 h2{letter-spacing: 0.5cm} // 2px h3 {text-align: right} //
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
Tutorial 2: Formatting Text. Objectives Session 2.1 – Learn the functions of the Common toolbar – Change the size of text – Discern which fonts to use.
Week 7 Web Typography. 2 Understanding Type Design Principles.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Tutorial 3 – Designing a Web Page Working with Color & Graphics Mrs. Wilson.
Cascading Style Sheets SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
Tutorial 3 Working with Cascading Style Sheets. XP Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external.
Designing a Web Page Working with Fonts, Colors, and Graphics.
Working with Fonts, Colors, and Graphics
XP Tutorial 3New Perspectives on HTML and XHTML, Introductory 1 Designing a Web Page Working with Fonts, Colors, and Graphics Tutorial 3.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Working with Fonts, Colors, and Graphics HTML: Tutorial 3.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
+ Text & Font Styles Unit 3 Lesson Different Font Categories Sans Serif – block style fonts Example - Rockwell Easy to read and good to use when.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
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.
Cascading style sheets (CSS)
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Principles of Web Design 6 th Edition Chapter 5 – Web Typography.
Cascading Style Sheet (CSS)
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WORKING WITH CASCADING
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
Tutorial 3 Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are declarations that describe the layout and appearance.
Chapter 6 Web Typography. 2 Principles of Web Design Chapter 5 Objectives Understand principles for type design on a Web site Use the element Understand.
XP Tutorial 3New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Designing a Web Page Working with Fonts, Colors, and Graphics Tutorial.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
1 Working with Cascading Style Sheet (CSS) (contd.)  What we will cover… 1. Color (decimal and hexadecimal representation) 2. Floating elements 3. Styling.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Tutorial 3 Working with Cascading Style Sheets (CSS)
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
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.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
CHAPTER 2 LIST-FORMATTING AND EDITING CHAPTER 2 LIST-FORMATTING AND EDITING.
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.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
Microsoft Expression Web 3 – Illustrated Unit F: Enhancing a Design with CSS.
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,
CIS234A Lecture 5 Instructor Greg D’Andrea. Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style:
Cascading Style Sheets Web Design Fairport High School.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
CSS Cascading Style Sheets *referenced from
Tutorial 3 Designing a Web Page with CSS
CSCE Chapter 3 (Cascading Style Sheets) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department of Computer.
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.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
XP Tutorial 3New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Page Working with Fonts, Colors, and Graphics Tutorial 3.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
CNIT 131 Graphics.
ITE 115 Designing a Web Page Patrick Healy, NVCC, ITE115
CSS Layouts CH 13.
Madam Hazwani binti Rahmat
Objectives Explore the history of CSS
Cascading Style Sheets Color and Font Properties
Tutorial 3 Working with Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

Let’s do it with Style! Fonts, Colors, and Graphics CSCI 202 Day 1 (Fall 2014) Font/Colors CS 202 1

But first… Introduction Syllabus Rules of the game Canvas – If you see in your inbox a message from "Canvas at WWU“, that message will have class- related information. HTML-XHTML review And on to chapter 3 of your book… Font/Colors CS 202 2

Objectives How HTML handles color Foreground and background colors Font styles and designs Align text with surrounding content with styles Control spacing between letters, words, and lines with styles Different image formats Apply background images to an element Float images Set the margin size around an element Remove a border from a linked image Where are we? Chapter 3 of the book! Font/Colors CS 202 3

Working with Color in HTMLColor in HTML HTML is “text-based” – Require to define colors in textual terms HTML identifies a color in one of two ways: – by the color name – by the color value color value: a numerical expression that precisely describes a color For more control and choices, specify colors using color values Font/Colors CS 202 4

Adding the Three Primary Colors Font/Colors CS Primary color model for light primary colors: red, green, and blue By varying the intensity of each primary color, we create many colors/shades

RGB (Red, Green, and Blue) Triplets Software programs define color mathematically In most programs, we make color choices with visual tools The intensity of each of three colors (RGB) is assigned a number from 0 (absence) to 255 (highest) distinct colors can be defined Each color is represented by a triplet of numbers – RGB triplet – White has a triplet of (255,255,255), RGB at highest intensity – Yellow has the triplet (255,255,0) RG, no blue Font/Colors CS 202 6

Hexadecimal Values HTML states color values in hexadecimal – for values above 15, use a combination of the 16 characters – 16 is expressed as “10”, 17 as “11”, and so forth To represent a number in hex, convert the value to multiples of 16 plus a remainder. 21 = (16 x 1) + 5 => hex representation is = (16 x 15) + 15 => hex representation is FF – first F represents number of times 16 goes into 255 (15) – second F represents the remainder of 15 Once you know the RGB triplet of a color, the color needs to be converted to the hexadecimal format Font/Colors CS 202 7

Using Color Values A palette is a selection of colors When a color that is not in its palette, it attempts to render the color ( dithering )dithering Use colors from the safety palette to avoid dithering Web-safe colors – The 216 colors in the safety palette216 colors – And 140 color names (17 from HTML and 123 from CSS)140 color Font/Colors CS 202 8

Defining Foreground and Background Colors Foreground color definition: – color: color color is either the color value or the color name Background color definition: – background-color: color You can apply foreground and background colors to any page element Font/Colors CS 202 9

Defining Foreground and Background Colors To define the background color for an entire page: – Add the bgcolor attribute to the tag To define the text color for an entire page: – Use the text attribute An example of background and text color changes including the color’s hexadecimal value: – Font/Colors CS

Defining Foreground and Background Colors Font/Colors CS

Working with Fonts and Text StylesFonts and Text Styles  A specific font  Times New Roman, Arial, or Garamond if installed on a user’s computer  A generic font refers to the font’s general appearance  Serif ( finishing strokes)  Sans-serif (plain stroke endings)  Cursive (generally have either joining strokes or other cursive characteristics)  Fantasy (primarily decorative)  Monospace (same fixed width) Font/Colors CS

Working with Fonts and Text Styles Font/Colors CS Generic fonts

Using the Tag Specify color, size, and font to be used for text on a Web page Syntax for the tag is: text – size attribute – color attribute of the tag allows you to change the color of individual characters or words Specify the color by using either a color name or color value Bozo If there is no color specified in the tag, the default colors of the Web browser is used – face attribute specifies a particular font for a section of text – But is now deprecated….deprecated Font/Colors CS

Setting the Font Size The style to change the font size of text within an element: – font-size: length Absolute units define a font size using one of five standard units of measurement: – Millimeters (mm) – Centimeters (cm) – Inches (in) – Points (pt) – Picas (pc) Font/Colors CS

Spacing and Indentation Tracking – amount of space between words and phrases Kerning – amount of space between pairs of letters Leading – amount of space between lines of text Font/Colors CS

Controlling the Spacing and Indentation Tracking – word-spacing: value Kerning – letter-spacing: value Leading – line-height: length Font/Colors CS

Font Styles and Weights To specify font styles, use the following style: – font-style: type To control font weight for any page element, use the following style: – font-weight: weight To change the appearance of your text, use the following style: – text-decoration: type Font/Colors CS

Decorative Features Underline, overline: – text-decoration: underline overline Capitalize: – text-transform: capitalize Uppercase letters, small font: – font-variant: type See the reference window on page HTML 127 for more information on setting font styles Font/Colors CS

Text Alignment (top)top Font/Colors CS

Controlling Image Alignment The syntax for the float style is: float: position Font/Colors CS

Controlling Image Alignment The align attribute can control the alignment of an image with the tag The syntax for the align attribute is: – alignment indicates how you want the graphic aligned in relation to the surrounding text Font/Colors CS

Alignment Options Font/Colors CS Aligns the top of the object with the top of the text. The top of the text is the baseline plus the standard height of an ascender in the text. top Aligns the top of the object with the absolute top of the surrounding text. The absolute top is the baseline plus the height of the largest ascender in the text. texttop Aligns the object to the right of the surrounding text. All subsequent text flows to the left of the object.righright Aligns the middle of the object with the surrounding text.middle Aligns the object to the left of the surrounding text. All preceding and subsequent text flows to the right of the object. left Aligns the bottom of the object with the bottom of the surrounding text. The bottom is equal to the baseline minus the standard height of a descender in the text. bottom Aligns the bottom of the object with the baseline of the surrounding text.baseline Aligns the middle of the object with the middle of the surrounding text. The absolute middle is the midpoint between the absolute bottom and text top of the surrounding text. absmiddle Aligns the bottom of the object with the absolute bottom of the surrounding text. The absolute bottom is equal to the baseline of the text minus the height of the largest descender in the text. absbottom Descriptionalign=

Margins  Control your margins with the following four styles:  margin-top: length  margin-right: length  margin-bottom: length  margin-left: length  Margin values can also be negative- this creates an overlay effect by forcing the browser to render one element on top of another  You can also combine the four margin styles into a single style Font/Colors CS

Inserting a Background Image The background attribute allows an image file for the background of a Web page The syntax for inserting a background image is: background-image: url(url) – URL is the location and filename of the graphic file you want to use for the background of the Web page For example, to use an image named “bricks.gif” as a background image, you would use the tag: Font/Colors CS

Background Image When choosing a background image – use an image that will not detract from the text – Don’t use large image files (> 20 kilobytes) increase the time it takes a page to load – be sure to take into consideration how an image file looks when it is tiled in the background – – Font/Colors CS

Background Image Options css/background_attributesboth.htm background_attributes_x.htm background_attributes_y.htm background_attributesnorepeat.htm Font/Colors CS background-repeat: type