Introduction to Programming the WWW I

Slides:



Advertisements
Similar presentations
The Web Wizards Guide to HTML Chapter Six Tables.
Advertisements

The Web Wizards Guide to HTML Chapter Five Working with Images.
Computers: Tools for an Information Age Writing Your Own Web Page: Using HTML and Web Authoring Tools.
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.
Adobe Photoshop CS Design Professional FOR THE WEB CREATING IMAGES.
Chapter 17 Creating Images for the Web. Chapter Lessons Learn about Web features Optimize images for Web use Create a button for a Web page Create slices.
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.
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.
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.
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.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Web Graphics Image File Formats Image optimization Accessibility issues Using images and colors on the web.
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
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 3.
1 Mastering the Internet and HTML Images and Image Tags.
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.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
HTML 4 Foundation Level Course HyperText Markup Language Most common language used in creating Web documents. You can use HTML to create cross-platform.
Department of Information Technology Chapter 8 - Creating Hypertext links Lecturer: Ms Melinda Chung.
Chapter 5 Web Graphics Styling Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer Foundations: Using XHTML Chapter 4 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 4 Key Concepts.
The Web Wizard’s Guide to HTML Chapter One World Wide Web Basics.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 5.
Project 2 Web Page Design Creating and Editing a Web Page Pages
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.
Chapter 2 Web Page Design Mr. Gironda. Elements of a Web Page These are things that most web pages use.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Adding Graphical Elements Essentials for.
Adobe Photoshop CS3 Revealed – Chapter 16 FOR THE WEB CREATING IMAGES.
Internet Applications Development Lecture 4 L. Obead Alhadreti.
FILE TYPES FOR WEB DESIGN 1 HOW SHOULD I SAVE?. GRAPHICS INTERCHANGE FORMAT (GIF) Best used for flat-color, sharp-edged art or text Clip art, logos Compression.
The Web Wizard’s Guide to HTML Chapter Three Colors, Patterns, and Inline Graphics.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
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.
Introduction to Programming the WWW I CMSC Winter 2004 Lecture 3.
Slide 1 Graphics (Characteristics 1) Images have various characteristics that affect performance Size (number of pixels) – Large images can be several.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 5.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 4.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 4.
HTML III ECT 270 Robin Burke.
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
Marking Up with XHTML Tags describe how a web page should look
Inserting and Working with Images
Images, Links and Multimedia
Hyperlinks, Images and Tables
Web Development & Design Foundations with HTML5 7th Edition
Graphics (Characteristics 1)
TABLES.
Web Design and Development
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
Creating Images for the Web
Introduction to HTML- Basics
Attribute of heading, <p> and <hr> tag
Attribute of heading, <p> and <hr> tag
Hyperlinks, Images and Tables
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
Lesson 3: Cascading Style Sheets (CSS) and Graphical Elements
Attribute of heading, <p> and <hr> tag
Marking Up with XHTML Tags describe how a web page should look
Presentation transcript:

Introduction to Programming the WWW I CMSC 10100-01 Summer 2003 Lecture 4

Topics Today More about basic HTML More about images Image map Table Validation Comment Special Characters More about images Image map Table

Reminder Homework1 due midnight this Wednesday Do the last requirement “Validate your page through the W3C validator before you're done with the assignment” after this class No class on July 4th (this Friday)

Web page validation service http://validator.w3.org/file-upload.html Checks your syntax against the document type you specify Can help you find missing end tags, nonnested tags, other errors

Document types All document types are of the SGML form doctype can be <!DOCTYPE HTML PUBLIC “-//W3C//DTD doctype//EN”> doctype can be HTML 4.01 Strict HTML 4.01 Transitional earlier versions of HTML varieties of XHTML,XML We use “HTML 4.01 Transitional” Document Type Definition (DTD) Defines the tags and syntax that are used to create an HTML document HTML 4.01 Transitional DTD (see IMG element)

Validation example: Example: bad.html Why is it bad with HTML 4.01 Transitional? What else is bad with HTML 4.01 Strict? It is easy to mess up nestings for tables, lists, etc

HTML Comments What is comments? Comments tag Example Part of HTML textual content Not rendered by browser Comments tag <!-- and --> Example comment.html

Special Character Encoding Several characters have special meanings in HTML <, >, and & etc We use a special encoding to use them Numerical Code: < Symbolic Code: < Not all have symbolic code Check ASCII table for numeric code Also see Appendix pp. 176-177

Special Character Example specialchar.html

Inline Images The src attribute inside the img tag is used to add an image to a Web page: <img src=“donut.gif”> GIF and JPG are the most commonly used file formats for inline images – browsers only recognize GIF, JPG, and PNG image formats

Paths The src attribute for an image file retrieves images from the same directory as the HTML file containing the img tag: <img src=“donut.gif”> If you want to retrieve an image from a different directory, you can add path information to the file name: <img src=“pix/donut.gif”> You can also specify a URL to link an image from outside

Image Attributes The align attribute positions the image and enables text to flow around an image The height and width attributes scale the image to any size you like The alt attribute allows you to describe the image in text for browsers that can’t display the image. Also helpful to text->voice conversion

Flowing Text Use the align attribute to make text flow alongside an image: <img src=“donut.gif” align=“left”> positions the image on the left side of the page and allows text to run down its right side

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

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

GIF (cont’d) Dithering Lossless Interlaced GIF Transparent GIF Example: JPEG file vs. GIF file Lossless Interlaced GIF Equals progressive JPEG Example: car-interlaced.gif Transparent GIF Animated GIF

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

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

Lossy Image Compression Trades image quality for memory savings Very good for minimizing bandwidth You control the trade-off when you save the image Example: lossy.html Supported by JPEG, not by GIF or PNG

Interlaced GIFs Displays images incrementally in four passes Gives users something to look at while the image is still downloading Any GIF image can be converted to an interlaced GIF GiFFY

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-foreground.html

Animated GIFs The GIF file format supports cartoon animations An animated GIF is stored in a single GIF file To display an animated GIF, just specify the GIF file in the SRC attribute of an IMG tag Animated GIF tools Animagic GIF Examples Rolling Star Traffic Light

Thumbnail Previews Let your visitors decide if they want to download a large (bandwidth intensive) image Use lossy file compression to create a small (light bandwidth) thumbnail version of the original image Make the thumbnail sketch a link label so users can click through to the original image if they want it Example thumbnail.html

Making 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 Example

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

Bandwidth Limitations Image files consume more bandwidth than text files Users who access the Internet via telephone lines will have to wait for image files that are 100KB or larger Whenever possible, use image files no larger than 30-40KB

Battling Bandwidth Limitations Always specify height and width attributes for all your 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 JPGs Use the 1x1 image trick (with caution)

Image Maps Navigational menus and navigation bars have clickable regions that take the user to different locations HTML’s map element makes it possible to specify different clickable regions within a single image Image maps can be created manually with the “ISMAP trick” or with the help of an image mapper Best created with software Example: Imagemap.html course’s web page

The Table Element Each table tag pair <table></table> can hold any number of table rows Each table row tag pair <tr></tr> can hold any number of table data items Each table data tag pair <td></td> can hold text, images, and other HTML elements Each table head tag pair <th></th> has a different appearance than table data.

Typical Table Sketch Code <caption>Sample Table</caption> <tr> <th>headrow-col1</th> … <th>headrow-coln</th> </tr> <td>row1-col1</td> <td>row1-coln</td> <td>rowm-col1</td> <td>rowm-coln</td> </table> sampletable.html

Table Cells A table cell is another name for a table data element Tables cells can be distinguished by their own background colors, patterns, type fonts, alignments, etc. Example: tablecell.html A table containing a single cell can be used to frame an image or offset important text Example: singlecell-imge.html

table Tag Attributes align bgcolor, background border cellpadding values: left, right bgcolor, background border values: n (an interger) cellpadding margin between cell content and cell border cellspacing space between adjacent cells width value: n(an integer), or n%

table Tag Attributes (cont’d) You can center HTML elements on a Web page by embedding them inside a single-celled table with a width=“100%” table attribute and an align=“center” table data attribute A border=“5” table attribute creates a 3-D picture frame for a single-celled table containing an image