Introduction to Programming the WWW I CMSC 10100-1 Winter 2004 Lecture 3.

Slides:



Advertisements
Similar presentations
The Web Wizards Guide to HTML Chapter Five Working with Images.
Advertisements

Iframes & Images Using HTML.
Web Development & Design Foundations with XHTML Chapter 4 Key Concepts.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 4 Marking Up With Html: A Hypertext Markup Language Primer.
Tutorial 3 – Designing a Web Page Working with Color & Graphics Mrs. Wilson.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 4: Horizontal Rules and Graphical Elements.
1 IMAGES: A Picture Is Worth a Thousands Words, Image Formats Choosing an Image Format Image Sizes Bits Per Pixel Graphic Tips Image Tag Attributes Line.
Web Page Creation Part I ST: Introduction to Web Interface Design Prof. Angela Guercio Spring 2007.
Images & Tables. Three graphic file types are supported by today's browsers: GIF - Graphic Interchange Format JPEG - Joint Photographic Experts Group.
Tutorial 3 Designing a Web Page.
1 IMAGES: A Picture Is Worth a Thousands Words, Image Formats Image Sizes Graphic Tips Image Tag Attributes Centering Images.
Instructor: A. Burns 1 HTML Images. Instructor: A. Burns 2 Inserting a Graphic Images can be displayed in two ways: as inline images or as external images.
Marking Up With Html: A Hypertext Markup Language Primer
Creating the pages Part Five Graphics. File Format Basics You can currently use only three image file formats on the Web: GIF, JPG, and PNG. A new format,
© 2005 ComputerPREP, Inc. All rights reserved. HTML 4.0 and Web Page Design Module I.
Chapter 5 Web Graphics Styling Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Chapter 3 Adding Images in HTML. Agenda Understanding Web Page Images Prepare Your Images for the Web Insert an Image Specify an Image Size Add Alternative.
ULI101: XHTML Basics (Part III) Introduction to XHTML / Continued … Block-Level vs. Inline Elements (tags) Manipulating Text,  , Text Characteristics,,,,,,,,,,,,,,,
Chapter 14-Designing for the World Wide Web. Overview Introducing multimedia on the Web. Designing text for the Web. Creating images for the Web. Adding.
Chapter 4 Fluency with Information Technology L. Snyder Marking Up With HTML: A Hypertext Markup Language Primer.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Adding Images & Working with Images Unit 2. TITLE CORNELL NOTES TOPIC: NOTES: Name: Date:08/10/2009 Period : Summary: To display Art To display Photographs.
Unit E. Image Measurements The size of an image can be measured 2 ways: Dimensions: the height and width, measured in pixels. File Size: measured in Kilobytes.
Chapter 4 Adding Images. Chapter 4 Lessons Introduction 1.Insert and align images 2.Enhance an image and use alternate text 3.Insert a background image.
Colors, Images, & Image Maps. Working with Color Colors are defined in terms of RGB Triplet –Red, Green, Blue –0 to 255 in intensity –(00, 00, 00) is.
Graphic images for computers Stored in files of binary data - Binary blobs Software has to know the binary format to decode the file and render an image.
HTML Boot Camp: Rules and Images
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 4: Horizontal Rules and Graphical Elements © 2007 Prosoft Learning Corporation All rights.
Site Development Foundations © 2004 ProsoftTraining All rights reserved.
IT Introduction to Website Development Welcome!
Chapter 7 Graphics and Color. 2 Principles of Web Design Chapter 7 Objectives Understand the differences between the Web-based image file formats - GIF,
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 3.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Copyright © 2003 Pearson Education, Inc. Slide 4-1 Created by, Stephanie Ludi, Rochester Institute of Technology—NY Basic Web Page Construction Graphics.
CSCE Chapter 5 (Links, Images, & Multimedia) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department.
Images Inserting an image on a web page. chcslonline.org2 ITEMS REQUIRED Go to the course download page on the course website and download the 3 images.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 2 HTML TAGS G H E F.
Department of Information Technology Chapter 8 - Creating Hypertext links Lecturer: Ms Melinda Chung.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 3.
Most of the attributes of the body element specify colors for the Web page. Note: The background attribute won’t be useful till we learn about graphics.
1 Web Developer Foundations: Using XHTML Chapter 4 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 4 Key Concepts.
Adobe Dreamweaver CS3 Revealed CHAPTER THREE: WORKING WITH TEXT AND IMAGES.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 2.
Adding Images Learning Web Design: Chapter 7. Using an Image Images have many purposed on a Web site Used as a static image To add illustration: ex. A.
1 Using HTML and JavaScript to Develop Websites. Using Images.
HTML tags Some popular ones. Paragraph: separated by a single line of white space Line break NOTE: no end tag is used for this tag Headlines ( through.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Adding Graphical Elements Essentials for.
COS 125 Day 4. Agenda Assignment 1 Due Assignment 2 Posted –Due Feb 9:35 AM Today we will look at creating and using images Examples –
Internet Applications Development Lecture 4 L. Obead Alhadreti.
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.
The Web Wizard’s Guide to HTML Chapter Three Colors, Patterns, and Inline Graphics.
Lecture 15. A Very Brief Introduction to HTML and XHTML, part IV Instructor: Jie Yang Department of Computer Science University of Massachusetts Lowell.
Kevin Murphy Images and Web Pages Masters Project CS 490.
Web Page Design Mrs. Ricke. Graphics Interchange Format 256 colors only Good for icons, clipart, logos Not good for high quality pictures.
ECA 228 Internet/Intranet Design I HTML Tags. ECA 228 Internet/Intranet Design I anchor tags Adds a link to the web page Anything placed between the anchor.
WEB GRAPHICS EXPLORING COMPUTER SCIENCE - LESSON 3-4.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 4.
Part 4 Text & Fonts © UNT in partnership with TEA1IT: Web Technologies - HTML Scripting.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 4.
HTML III ECT 270 Robin Burke.
CNIT 131 Graphics.
Exploring Computer Science - Lesson 3-4
Exploring Computer Science - Lesson 3-4
Introduction to Programming the WWW I
Exploring Computer Science - Lesson 3-4
Web Development & Design Foundations with HTML5 7th Edition
Web Design 3080 : Week 3 Introduction to Dreamweaver Lecture
Lesson 3: Cascading Style Sheets (CSS) and Graphical Elements
Presentation transcript:

Introduction to Programming the WWW I CMSC Winter 2004 Lecture 3

2 Today’s Topics Text formatting  Fonts, colors  Control white space and special characters Images

3 Reminder Hw1 due this Thurs. MacLab tutorials MacLab Register online Make an appointment if you need help

4 Fonts Basic tag:  formats contained text Attributes  face  size  color

5 Font faces The face attributes tells browser what font face (or "typestyle") to use for the text Fonts installed on browsers varies widely:  age, platform, user preferences It is best to specify type faces in groups since different computers use different type fonts: face=“ Arial, Helvetica, Geneva, sans-serif ” face=“ Times, Courier, Courier New, serif ” Browsers select a default if none of the faces are found

6 Font faces (cont’d) Best to stick with “safe” fonts and use other features for effect (HTML pp ) Generic font families  sans-serif fonts: Arial, Helvetica, Geneva, etc  serif fonts : Times, Times New Roman  monospaced fonts : Courier, Courier New  Suggestions serif for body, sans for title use for monospaced

7 Font sizes Size is controlled by the size attribute  Can specify an “absolute” size value of “1” through “7”, “3” indicates normal depends on browser and font face  Can specify a “relative” size value from “-2” to “+4” This is relative to the current font size Example:  font_example.html font_example.html

8 Font colors Controlled with the “ color ” attribute  Most browsers recognize a list of text names aqua, black, blue, green, red, etc See HTML p. 43 for a list  Also recognize RGB codes in hexadecimal  Prefer to use 216 “Web safe” colors They are fairly consistent across platforms Ref: 216 Web-safe color table216 Web-safe color table

9 Hexadecimal Colors hexadecimal notation  Base 16 instead of 10 (uses plus A - F)  “FF” = 15 * * 1 = 255; “13” = 1 * = 19  Use “#” followed by three two-digit numbers in sequence for a color E.g: red = #ff0000  In total, we have 16,777,216 colors (2 24 ) (why?)  Example: colors.html bgcolorexample.html

10 A note about fonts is deprecated  Still part of HTML standard but will be removed in the future  Cascading Style Sheets (CSS) is a better solution Why deprecated elements?  Easier to “get going” than CSS  Still be recognized by browsers for a good while  Lots of existing HTML uses them, so you should be able to read/understand that code Ref: Break the HabitBreak the Habit

11 Controlling white space HTML browsers do their own thing with white space  Example: whitespace.htmlwhitespace.html There are some ways around this:  nonbreaking white space:  line breaks:  block quotes:  preformatted text:  preformatted plain text: (obsolete)

12 Text styles Styles bring better readability Content-based text styles  The style tags have specific usage or meaning  Can be rendered in different ways by browsers Physical styles  Tell browser to display text in a particular physical style Example: textstyle.htmltextstyle.html

13 Special Text Characters Special characters include those  Can not be typed from keyboard. e.g: ®  Have special meaning. e.g:, & The solution is using character entity  character reference consists of an ampersand (&), a pound sign (#), a numerical value, and a semicolon (;). for example, < is < Numeric value is the character position number in ASCII tableASCII table  entity reference consists of an ampersand (&), a character string, and a semicolon (;). for example, < is < Example: specialchar.htmlspecialchar.html

14 Images Background images Inline images  specifying a source file  flowing text  size and other attributes

15 Background images Set with the background attribute of body Can be used along with bgcolor The picture is tiled to fill the screen  Make sure the tiling looks nice  Make sure the image doesn’t conflict with text Make the file be small for fast downloads Example:  backgoundexample.html backgoundexample.html

16 Inline images Use the standalone tag with attributes to control:  image file to include (required)  alternate text if image is not displayed (required)  Border and spacing  image alignment within text  height and width of image

17 Including the file src attribute specifies the image file Can be:  URL for online file (this can be risky!)  local file with absolute or relative path alt attribute gives alternate text:  text-only browser  error loading image  voice-text converter Example: imgexample.htmlimgexample.html

18 Image alignment To control over the alignment of images with the surrounding text  default alignment is typically ugly The align attribute helps  “ left ” and “ right ” push image to edge and flow text around it  “ bottom ”, “ top ”, “ middle ” are used if image appears within the text Example:  image-examples.html image-examples.html  Images.html Images.html

19 Image border and spacing The border attribute  Control the thickness of the border  The value is an integer in pixels (default is 0)  Useful when rendering image as hyperlink The hspace and vspace attributes  Specify the number of pixels of extra space to leave between the image and the text on its left and right sides Example:  Image-border-spacing.html Image-border-spacing.html

20 Resizing the image Specify the height and width Preserve the aspect ratio This affects the size the image appears, not the size of the file  Use Photoshop or other tool to create smaller image file with coarser resolution, etc Example: imgexample_resize.htmlimgexample_resize.html

21 Image File Formats GIF:  Graphics Interchange Format JPEG:  Joint Photographic Experts Group PNG:  Portable Networks Graphics

22 GIF (Graphics Interchange Format) Uses an adaptive 8-bit color palette  256 colors at most Especially suitable for line art and cartoons Can work well for some photographs Patent issues  LZW algorithm for image compression

23 GIF (cont’d) GIF dithering in photos  Example: gifdithering.htmlgifdithering.html Image compression is lossless Coo features  Interlaced GIF  Transparent GIF  Animated GIF

24 Interlaced GIFs Displays images incrementally  equals to progressive JPEG  example: car-interlaced.gifcar-interlaced.gif Gives users something to look at while the image is still downloading Any GIF image can be converted to an interlaced GIF  Tools: GiFFY, convertGiFFY

25 Transparent GIFs Transparent regions in an image allow the background color or pattern of a Web page to show through Any GIF image can be made transparent by specifying one color in the image that defines its transparent regions How to make transparent GIFs?  The background of a photograph can be made transparent after some graphics editing Examples  transparent-background.html transparent-background.html  transparent-foreground.html transparent-foreground.html

26 Animated GIFs The GIF file format supports cartoon animations An animated GIF is stored in a single GIF file Use same rule to display an animated GIF Tools to create animated GIF images  Animagic GIF Animagic GIF Examples  Rolling Star Rolling Star  Traffic Light Traffic Light

27 JPEG (Joint Photographic Experts Group) Uses a fixed 24-bit color palette (millions of colors) Especially suitable for high-resolution photographs Uses lossy file compression  trades image quality for memory savings  very good for minimizing bandwidth  you control the trade-off when you save the image Example: lossy.htmllossy.html  Lossy compression only supported by JPEG

28 PNG (Portable Network Graphics) W3C free stand-in format for GIF Often smaller than GIF Lossless (like GIF) Does not support animation

29 Thumbnail previews Use lossy file compression to create a small (light bandwidth) thumbnail version of the original image  Usually make the thumbnail sketch a link to a big sized image (bandwidth intensive)  Users can decide if they want to click through to the original image Example  thumbnail.html thumbnail.html

30 How to make thumbnails Load image in a program (e.g. Photoshop) Reduce the image quality under the save options Set a small height and width in the page Will be covered in the PhotoShop tutorial

31 Convert image files Use the command “ convert ” in Linux  Part of Image Magic  installed in our department Linux system  Can get (via fink) version for Mac OSXfink  can reduce image quality, do interlacing  convert -quality 10 foo.jpg foo.tn.jpg  More details about how to use “convert”details

32 Battling bandwidth limitations Images consume more bandwidth than text files, so use images no larger than 30-40KB whenever possible  dial-up users have to wait for image files >= 100KB Always specify height and width attributes for images so the browser can “work around” each image while it is downloading Don’t put any large images at the top of a Web page Use interlaced GIFs and progressive JPEGs