Working with Fonts, Colors, and Graphics HTML: Tutorial 3.

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

Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
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} //
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.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
CASCADING STYLE SHEETS CSS. 2 What CSS means?  CSS is an extension to basic HTML that allows you to style your web pages.  It separates the part that.
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!
Let’s do it with Style! Fonts, Colors, and Graphics CSCI 202 Day 1 (Fall 2014) Font/Colors CS
Tutorial 3 – Designing a Web Page Working with Color & Graphics Mrs. Wilson.
Web Design & Development Cascading Style Sheets (CSS)
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
Tutorial 3 Designing a Web Page.
Multimedia and the World Wide Web HCI 201 Lecture Notes #7B.
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.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
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.
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.
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.
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.
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.
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.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
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.
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.
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
Web Design (14) CSS Formatting Text. Formatting Text In Brackets, go to your ‘externalcss’ website and find the ‘formattingtext’ page. Use the ‘main’
CSS Cascading Style Sheets *referenced from
Tutorial 3 Designing a Web Page with CSS
03 CSS (Cascading StyleSheet) Р.Жавхлан МОНГОЛ УЛСЫН ИХ СУРГУУЛЬ Мэдээллийн технологийн сургууль Интернэт технологийн үндэс 2015 Намар.
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)
XP Tutorial 3New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Page Working with Fonts, Colors, and Graphics Tutorial 3.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 10: Formatting Text with Styles.
CNIT 131 Graphics.
ITE 115 Designing a Web Page Patrick Healy, NVCC, ITE115
The Internet 10/13/11 The Box Model
Tutorial 3 Working with Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

Working with Fonts, Colors, and Graphics HTML: Tutorial 3

Chang-Yang Lin, EKU2 Tutorial Objectives  Learn how HTML handles colors  Create foreground and background colors using styles  Select different font styles  Align text with surrounding content using styles  Control spacing between letters, words, and lines using styles  Learn about GIF, JEPG, PNG; animated graphics

Chang-Yang Lin, EKU3 Tutorial Objectives (continued)  Apply a background image  Float an image  Create image map hotspots and link them to destination documents

Chang-Yang Lin, EKU4 Working with Color in HTML HTML identifies a color in one of two ways:  by the color’s name red, maroon, green, black, blue, purple  by the color values To have more control and more choices, specify colors using color values.

Chang-Yang Lin, EKU5 The 16 Basic Color Names

Chang-Yang Lin, EKU6 Partial List of Extended Color Names

Chang-Yang Lin, EKU7 Basic Principles of Color Theory  Any color can be a combination of three primary colors: red, green, and blue.  By varying the intensity of each primary color, you can create almost any color. Yellow, magenta, cyan, and white are produced by adding the three primary colors.

Chang-Yang Lin, EKU8 RGB Triplets  Each color is represented by a triplet of numbers, called an RGB triplet, based on the strength of its Red, Green, and Blue. rgb (red, green, blue) where red, green, blue are the intensity values of the red, green, and blue components.  The intensity values range from 0 (absence of color) to 255 (highest intensity).  (or more than 16.7 million) colors can be defined.

Chang-Yang Lin, EKU9 Color Values in Hexadecimals  Color values can also be entered as hexadecimals in the form: #RedGreenBlue  A hexadecimal is a number based on base-16 hexadecimals include six extra characters: A (for 10), B (for 11), C (for 12), D (for 13), E (for 14), and F (for 15). 16 is expressed as “#10”, 17 as “#11”, 38 as “#26”, 165 as “#A5”, and 255 as “FF” in hexadecimal format.

Chang-Yang Lin, EKU10 A Typical Colors Dialog Box

Chang-Yang Lin, EKU11 Color Names, RGB Triplets, and Hexadecimal Values

Chang-Yang Lin, EKU12 Color Selection Resources Available on the Web     e.html

Chang-Yang Lin, EKU13 Defining Foreground and Background Colors  The default browser scheme involves: black text on a white or gray background hypertext links highlighted in purple and blue  The syntax for controlling a page’s color scheme through the tag is:

Chang-Yang Lin, EKU14 Choosing a Font  By default, browsers display Web page text in a single font, usually Times New Roman.  You can specify a different font using the style font-family: fonts  Font names can be either specific or generic. Five generic fonts: serif, sans-serif, monospace, cursive, and fantasy. <p style=“text-align: center; font-family: Arial, Helvetica, sans-serif”>

Chang-Yang Lin, EKU15 Setting the Font Size The style to change the font size of the text within an element is: font-size: length length can be specified in four different ways: 1.with a unit of measurement 2.with a keyword description 3.as a percentage of the size of the containing element 4.with a keyword expressing the size relative to the size of the containing element

Chang-Yang Lin, EKU16 Setting the Font Size 1. with a unit of measurement  Use either absolute units or relative units  Absolute units define a font size using mm (millimeter) cm (centimeter) in (inch) pt (points) pc (pica)  1 inch = 72 points; 1 pc = 12 points  Absolute measurements are useful when you know the physical properties of the output device

Chang-Yang Lin, EKU17 Setting the Font Size 1. with a unit of measurement Relative units express font size relative to the size of a standard character on the output device. Two common standards:  The “em” unit is equal to the width of the capital letter “M”.  The “ex” unit is equal to the height of a lower case letter “x”. Font size will be 80% of normal body text Font size will be 150% of normal body text

Chang-Yang Lin, EKU18 Setting the Font Size (continued)  The following are equivalent: font-size: 1.5em and font-size: 150%  A value is expressed in pixels (a single dot) if no unit is specified. font-size: 20 equals font-size: 20px  Express font sizes using 7 keywords: xx-small x-small small medium large x-large xx-large A browser is configured to display text at a particular size for each of these keywords. Use “larger” or “smaller” to make a font one size larger or smaller.

Chang-Yang Lin, EKU19 Control Spacing: Kerning and Tracking  The style to control kerning (the amount of space between pairs of letters) and tracking ( the amount of space between words): letter-spacing: value word-spacing: value  The default value for both kerning and tracking is 0 pixels. A positive (negative) value increases (decreases) the letter and word spacing.  Kerning will be set to 1 em

Chang-Yang Lin, EKU20 Control Spacing: Leading and Indentation  The style to set the leading (the space between lines of text) is: line-height: length line-height: 1 represents the standard ratio (1.2:1), which means the line height is 1.2 times the font size  The style to set the indentation is: text-indent: value  Welcome Welcome will be indented 1 em

Chang-Yang Lin, EKU21 Setting other Font features  font-style: type type is normal or italic  font-weight: weight weight is normal, bold or 100,., 400 (normal),., 700 (bold),., 900  text-decoration: type type is none, blink, underline, overline, linethrough  text-transformation: type type is capitalize, uppercase, lowercase, none  font-variant: type type is normal (default) or small caps

Chang-Yang Lin, EKU22 Combining all Text Formatting in a Single Style  font: font-style font-variant font-weight font-size/line-height font-family  font: italic small-caps bold 16pt/24pt Arial, Helvetica, Sans-serif  content Font style will be normal, not italic Font size will be 0.8 em Text will be in Arial, Helvetica, or another Sans-serif font

Chang-Yang Lin, EKU23 Using the Span Element  Use the span element as a marker, and then change the font style.  Exciting adventures await you at Arcadium, your affordable family fun center. The...

Chang-Yang Lin, EKU24 GIF (Graphics Interchange Format)  The three image file formats supported by Web browsers are GIF, JPEG, and png.  GIF files are limited to displaying 256 colors.  Often used for graphics requiring fewer colors, such as clip art images, line art, logos, & icons.  With a noninterlaced GIF the image is saved one line at a time, starting from the top of the graphic and moving downward.  With interlaced GIFs, the image is saved and retrieved “stepwise.”

Chang-Yang Lin, EKU25 Transparent GIFs  A transparent color is a color from the image that is not displayed.  In place of a transparent color, the browser displays whatever is on the page background. logo background is transparent in the browser

Chang-Yang Lin, EKU26 Animated GIFs  One of the most popular uses of GIFs is to create animated images.  An animated GIF is composed of several images that are displayed one after the other in rapid succession.

Chang-Yang Lin, EKU27 JPEG (Joint Photographic Experts Group)  The JPEG format uses the full 16.7 million colors.  JPEG files are often used for photographs.  A JPEG file size can be controlled by the degree of image compression.  You cannot use transparent colors or animation with JPEG files.

Chang-Yang Lin, EKU28 Dithering  Dithering is when the colors in an image are converted to a fixed palette.  To completely eliminate dithering, use the Safety Palette. the Safety Palette or browser-safe palette is a collection of 216 colors that display consistently on different browsers.  Given the growth of 24-bit (millions of colors) color systems, this is rapidly becoming less of an issue.

Chang-Yang Lin, EKU29 Portable Network Graphics (PNG)  PNG files include such GIF features as animation, interlacing, and transparency but also provide the file compression available with JPEGs.  PNG supports 16.7 million colors.

Chang-Yang Lin, EKU30 Aligning an Image  float: position position is none (the default), left, or right  Use the clear style to prevent other content from wrapping around a floating element. Clear: position position is none (the default), left, or right  image floats at the right margin line will not be displayed until the right margin is clear

Chang-Yang Lin, EKU31 Setting the Image Margins  To set the size of the margins around an element, use the styles: margin-top: length; margin-right: length; margin-bottom: length; margin-left: length or margin: top right bottom left 

Chang-Yang Lin, EKU32 Setting the Image Size  To set the size of an image:  Height and width attributes instruct the browser to display an image at a specific size.  When a browser encounters an image, it calculates the image size and then uses this information to format the page. If the dimension is included, the browser displays the image faster.

Chang-Yang Lin, EKU33 Inserting a Background Image  Insert a background image: background-image: url(url)  Control the tiling of the background image: background-repeat: type type is repeat (default), repeat-x, repeat-y, or no-repeat  Place the background image in a specific location: background-position: horizontal vertical Specify a position as the distance from the top-left corner, a %, or using a keyword ( left center right for horizontal; top center bottom for vertical)

Chang-Yang Lin, EKU34 Inserting a Background Image  Control whether the background image scrolls: background-attachment: type type is scroll (default) or fixed  Place all of the background image: background: color image-file repeat attachment position 

rides.htmkarts.htmwater.htm Image map pointing to multiple pages

Chang-Yang Lin, EKU36 An Example of a Image Map an example of a park map that visitors can easily find their way to the different attractions by clicking on the image

Chang-Yang Lin, EKU37 Understanding Image Maps  To use a single image to multiple targets, you must set up hotspots within the image.  A hotspot is a defined area of the image that acts as a hypertext link.  Hotspots are defined through the use of image maps, which list the positions of all hotspots within an image.  A client-side image map is inserted in an image map into the HTML file.  The browser locally processes the image map.

Chang-Yang Lin, EKU38 Defining a Client-Side Image Map  Create an image map: hotspots map is the name of the image map hotspots are the locations of the hotspots within the map  To create XHTML-compliant code, include both the name and id attributes, setting them to the same value To access an image map:

Chang-Yang Lin, EKU39 Defining Image Map Hotspots  To create a rectangular hotspot: x1,y1,x2,y2 represents the upper-left and lower- right corners url is the location of the linked page  To create a circular hotspot: x,y indicate the coordinates of the center and r specifies the radius

Chang-Yang Lin, EKU40 Defining Image Map Hotspots: a polygonal hotspot x1,y1,x2,y2,x3,y3,... indicate the vertices of the polygon following the clockwise roller coaster rides (13, 60) (13, 270) (370, 270) (370, 225) (230, 225) (230, 60)

Chang-Yang Lin, EKU41 An Example: Image Map <area shape="circle" coords="255,133,74" href="karts.htm" alt="go-karts" /> <area shape="poly" coords="17,38,172,38, 172,223,333,223,333,300,17,300" href="rides.htm" alt="Roller coasters" />