Introduction to Programming the WWW I CMSC 10100-1 Summer 2004 Lecture 4.

Slides:



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

The Web Wizards Guide to HTML Chapter Four All About Hyperlinks.
The Web Wizards Guide to HTML Chapter Five Working with Images.
CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Web Development & Design Foundations with XHTML Chapter 4 Key Concepts.
Chapter 4 Marking Up With Html: A Hypertext Markup Language Primer.
Images & Tables. Three graphic file types are supported by today's browsers: GIF - Graphic Interchange Format JPEG - Joint Photographic Experts Group.
© 2004, Robert K. Moniot Chapters 4 & 5 Introduction to HTML, More Details.
Tutorial 3 Designing a Web Page.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 3: Hyperlinks and 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.
Using HTML Tables.
AdvWeb-1/12 DePaul University SNL 262 Web Page Design Chapt 10 - Putting Graphics on A Web Page Instructor: David A. Lash.
Marking Up With Html: A Hypertext Markup Language Primer
Glencoe Digital Communication Tools Create a Web Page with HTML Chapter Contents Lesson 4.1Lesson 4.1 Get Started with HTML (85) Lesson 4.2Lesson 4.2 Format.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
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.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
File Formats COM 366 Web Design & Layout. Native file format –Format native to software program –.psd > PhotoShop default Preserves layers –Use “Save.
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
IT Introduction to Website Development Welcome!
HTML II ECT 270 Robin Burke. 2 Outline Review Images text flow links Image maps Colors Tables.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 3.
CSCE Chapter 5 (Links, Images, & Multimedia) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department.
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
Chapter 4: Hypertext Markup Language Primer TECH Prof. Jeff Cheng.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and attributes Create.
Unit 2, cont. September 12 More HTML. Attributes Some tags are modifiable with attributes This changes the way a tag behaves Modifying a tag requires.
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.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 5.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
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.
CP102 Module 7: HTML 1 Module 7: HTML 1.What is 1.What is HTML? 2. 2.Basic syntax, document structure 3. 3.Basic formatting, images, links 4. 4.Lists,
Adobe Photoshop CS3 Revealed – Chapter 16 FOR THE WEB CREATING IMAGES.
Chapter 2 Designing Web Pages With HTML JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin,
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
CSE 409 – Advanced Internet Technology 1 DISCUSSION OF BASIC HTML TAGS.
HTML (Hyper Text Markup Language) Lecture II. Review Writing HTML files for web pages – efficient compact – fundamental. Text files with htm extension.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Lecture 15. A Very Brief Introduction to HTML and XHTML, part IV Instructor: Jie Yang Department of Computer Science University of Massachusetts Lowell.
Introduction to Programming the WWW I CMSC Winter 2004 Lecture 3.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Slide 1 Graphics (Characteristics 1) Images have various characteristics that affect performance Size (number of pixels) – Large images can be several.
`. Lecture Overview HTML Body Elements Linking techniques HyperText references Linking images Linking to locations on a page Linking to a fragment on.
1999, COMPUTER SCIENCE, BUU Introduction to HTML Seree Chinodom
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 5.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 4.
HTML III ECT 270 Robin Burke.
Marking Up with XHTML Tags describe how a web page should look
Working with Tables: Module A: Table Basics
Introduction to Programming the WWW I
Graphics (Characteristics 1)
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
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
Marking Up with XHTML Tags describe how a web page should look
Presentation transcript:

Introduction to Programming the WWW I CMSC Summer 2004 Lecture 4

2 Today’s Topics Image (cont’d) Hyperlink Image map HTML tables

3 Note Maclab’s minicourses Maclab Hw1 due Wedn

4 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

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

6 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

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

8 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

9 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 Maclab’s PhotoShop tutorial

10 Convert image files Can achieved through many tools  Photoshop, Acdsee, etc You can use the “ convert ” tool 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  Example: convert -quality 10 foo.jpg foo.tn.jpg  More details about “convert”details

11 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

12 Hyperlink (link) Hypertext = text + links  Typically, you click on the hyperlink to follow the link Hyperlinks are the most essential ingredient of WWW  Link documents with other collections around the world

13 All Hyperlinks Have Two Parts The Link Label is the visible element that the user points to and clicks (link labels can be text segments or images) The Link Destination is the location that the link takes you to when you click on the link Only the link destinations are handled differently for absolute URLs, relative URLs, and named anchors

14 Anchor Tags Hyperlinks are created with the anchor tag  The href attribute is used to specify the link destination  Examples: this is a link label label

15 Different Types of Hyperlinks Absolute URLs  usually point to Web pages on other Web servers Relative URLs  point to Web pages on the same Web server Named Anchors  point to a different location on the current Web page

16 Absolute URLs All absolute URLs use complete URL addresses for their link destinations  Example format: UChicago Any Web page can be referenced by an absolute URL as long as you have its correct address  Example: Linkexamples.htmlLinkexamples.html

17 Relative URLs A relative URL need only specify a file name for its link destination: alternative solution This assumes the destination file is in the same directory as the HTML file containing the link If the file is in a different directory, pathing information must be added to the href value Example: Linkexamples.htmlLinkexamples.html

18 Named Anchors A named link destination specifies a location that has been marked by an anchor tag with a name attribute Good Lumber … some good lumber The href value is prefaced with the # character but the name value is not Example: Linkexamples.htmlLinkexamples.html

19 Named Anchors Combined with Other Links A named anchor can be added to an absolute or relative link as long as the destination being referenced contains that named anchor Some Good Lumber Just add a # followed by the anchor’s name to the end of the file name in the href value

20 Making anything a link You can enclose all sorts of elements inside  text  headings  pictures Making a picture a link: Example: imagelink.htmlimagelink.html

21 Control Link States link, vlink and alink  Attributes of body tag  All three accept color values Either hexadecimal RGB triplet or color name  Determine the color of all unvisited, already visited, and currently visiting hyperlinks

22 Link Maintenance An absolute link that works today may not work tomorrow Dead links frustrate visitors and detract from your Web pages To keep all of your links operational, you have to test them periodically and update any that have died

23 Image maps An image with different clickable regions (hot spots)  Each region can link to different document  Typically used in navigational menus and bars It is the joint-work of and elements  defines the hot spots and the linked destinations (standalone tag)  Attributes: shape, coords, href  uses the “usemap” attribute to associate to certain map

24 Image maps 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 Imagemap.html  course’s home page course’s home page

25 HTML Validation Validating your HTML will help insure that it displays properly on all browsers Typical validators  W3C W3C  Web Design Group Web Design Group Two required information for validation  Document Type Declaration Document Type Declaration It begins the HTML document and uses tag It tells which version of HTML to use in checking the document's syntax

26 HTML Validation (cont’d)  Character Encodings Character Encodings It tells validator which method to use to covert byte to characters  ISO is a typically used encoding You could set it by using a tag in the element of a HTML page 

27 HTML Tables Purposes of using tables  The obvious purpose of arranging information in a table  The less obvious - but more widely used - purpose of creating a page layout with the use of hidden tables

28 The Table Elements Each table tag pair can hold any number of table rows Each table row tag pair can hold any number of table data items Each table head tag pair has a different appearance than table data Each table data tag pair can hold text, images, and other HTML elements

29 Typical Table Sketch Code Sample Table headrow-col1 … headrow-coln row1-col1 … row1-coln … rowm-col1 … rowm-coln sampletable.html

30 Table Cells A table cell is another name for a table data element  A browser displays a cell only if it contains something Enter a nonvisible character to display the cell ( )  Example: sampletable.htmlsampletable.html Tables cells can be distinguished by  background colors - bgcolor  Patterns - background  alignment – align, valign  type fonts etc Example: tablecell.htmltablecell.html

31 table Tag Attributes align  values: left, center, right  default: left  A better method is to embed the table in a bgcolor, background border  values: n (an integer)  default: 0 width  value: n(an integer), or n%

32 table Tag Attributes (cont’d) cellpadding  margin between cell content and cell border  default: 2 cellspacing  space between adjacent cells  default: 2

33 A Note You can center HTML elements on a Web page by embedding them inside a single-celled table with attribute align set to “center” A border=“5” table attribute creates a 3-D picture frame for a single-celled table containing an image Example: a center framed image  singlecell-imge.html singlecell-imge.html

34 colspan and rowspan colspan and rowspan are table data attributes that are used to create irregular tables A table cell can be extended horizontally with the colspan attribute A table cell can be extended vertically with the rowspan attribute Example:  table_colspan.html table_colspan.html  table_rowspan.html table_rowspan.html  composite example (with both rowspan and colspan) composite example

35 Rules for Table Elements TD Rule 1: each row receives a TD element whenever the row has (1) a cell with no arrow or (2) a cell with the beginning of an arrow TD Rule 2: any TD tag corresponding to a cell that contains the beginning of a downward-pointing arrow receives a ROWSPAN attribute with a value equal to the length of the arrow TD Rule 3: any TD tag corresponding to a cell that contains the beginning of a rightward-pointing arrow receives a COLSPAN attribute with a value equal to the length of the arrow

36 Tables and Text Text is hard to read against a busy background pattern, but you can lay a table containing text on top of a background pattern without sacrificing readability (just give the table a solid background color)  Examples: table_text2.html vs. table_text1.htmltable_text2.htmltable_text1.html Tables can also be used to separate text into two columns (a cellpadding=“20” table attribute will put white space between the two columns)  Example: table_2col.htmltable_2col.html

37 Tables and Graphics Tables can be used to control a Web page layout for multiple images (or images mixed with text) Images of different sizes can be fit together in irregularly-shaped tables using cell-structure diagrams All tables have an underlying cell structure with a uniform number of table cells across each table row

38 Web Page Borders Empty table columns can be used to create margins for text on a Web page  Use a fixed width attribute (e.g. width=“50” ) for the empty table data element Put an internal table inside  Example: innertable.htmlinnertable.html Note: better to control margins with CSS

39 One vs. Many If you have one very large table, try to break it up into a sequence of smaller tables that can be stacked vertically on a Web page Browsers download the contents of an entire table before any of the table can be viewed Multiple tables will be displayed incrementally so the user will be able to see the first part of your page while the rest of the page is still downloading

40 Disadvantages of tables for layout Complex layout requires complex tables (lots of headaches, room for error) Complex tables can download, be rendered slowly Scalability issues  Not all browsers can read tables