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

Slides:



Advertisements
Similar presentations
The Web Wizards Guide to HTML Chapter Four All About Hyperlinks.
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.
Working with Images and HTML
Web Development & Design Foundations with XHTML Chapter 4 Key Concepts.
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.
Chapter 4 Marking Up With Html: A Hypertext Markup Language Primer.
Tutorial 3 – Designing a Web Page Working with Color & Graphics Mrs. Wilson.
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.
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.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 3: Hyperlinks and Images.
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
Chapter 5 Web Graphics Styling Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
HTML Tags. Objectives Know the commonly used HTML tags Create a simple webpage using the HTML tags that will be discussed.
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.
1 Outline 3.1 Introduction 3.2 Editing HTML 3.3 First HTML Example 3.4 W3C HTML Validation Service 3.5 Headers 3.6 Linking 3.7 Images 3.8 Special Characters.
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.
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.
IT Introduction to Website Development Welcome!
WEB DESIGN USING DREAMWEAVER. The World Wide Web –A Web site is a group of related files organized around a common topic –A Web page is a single file.
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.
Chapter 4: Hypertext Markup Language Primer TECH Prof. Jeff Cheng.
Understanding HTML Code
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
HTML Comprehensive Concepts and Techniques Second Edition Project 2 Creating a Web Site with Links.
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.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 2 HTML TAGS G H E F.
Chapter 5 Web Graphics Styling Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Images & Image Maps 16 th February. Images & Image Maps Web authors can add icons, logos and high impact images to their pages Images enhance web pages.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 3.
1 Web Developer Foundations: Using XHTML Chapter 4 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 4 Key Concepts.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 2.
1 Using HTML and JavaScript to Develop Websites. Using Images.
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.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 3.
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.
Project Two Adding Web Pages, Links, and Images Define and set a home page Add pages to a Web site Describe Dreamweaver's image accessibility features.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 2 and 3 Scott Marino.
The Web Wizard’s Guide to HTML Chapter Three Colors, Patterns, and Inline Graphics.
Introduction to Programming the WWW I CMSC Winter 2004 Lecture 2.
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.
Writing Your Own Web Page: Using HTML and FrontPage Chapter 10.
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 Summer 2004 Lecture 4.
Basic Web Design Week 3 - Graphics UVICELL. Web Graphics Concepts for Week 3 Selecting the right format for your image Creating a name banner for your.
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
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
Creating Images for the Web
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
Presentation transcript:

Introduction to Programming the WWW I CMSC Summer 2004 Lecture 3

2 Today’s Topics Linux introduction List, images, hyperlinks, image maps

3 Reminder Hw1 released and due next Wednesday

4 Introduction to Linux Very useful in networking, Web servers Not so easy to begin learning as Win/Mac We’ll cover some basics  directory structure and navigation  copying, deleting files  permissions  getting files from home or lab to the right place on the network

5 Directories Much like folders in Win/Mac Directory is hierarchical and organized as tree structure  Different levels are distinguished by “/”  Two special directory notations “..” denotes the parent directory “.” denotes the current directory You home directory is referred as ~  When you log in, you are in your home directory  E.g.: My home directory is ~hai and it is same as /home/hai

6 Basic directory commands The command ls tells you what is in the current directory The command pwd tells you what directory you are in The command cd followed by a directory name changes your current directory  cd.. goes “up” one directory in the tree  cd takes you “home”

7 Creating directories Command: mkdir  All your homework will be turned in to ~ /html/cs101/hw, where x is the no of the assignment.  From your home directory, type in mkdir html (creates the html directory) cd html (changes to the html directory) mkdir cs101 cd cs101 mkdir hw1 cd hw1 (you are now “in” the directory for your first homework assignment)

8 Copying and deleting files The commands cp and rm copy and delete files  Copy a file cp path must be specified for filenames default is current directory Example: cp foo.html foo_bak.html  Copy a directory cp –r  Delete a file/directory rm

9 File/directory permissions Type in ls -l  This pulls up a listing with more information  You should see something like:  The letters on the left are the permissions of each file  More about ls command ls drwxr-xr-x 2 hai student 512 May 12 15:48 tcltklib/ drwxr-xr-x 2 hai student 512 Jan 16 13:32 temp/ -rw-r--r-- 1 hai student 12 Oct test.in

10 Permissions cont’d. This information tells who can  read  write  execute The first entry is d or - (is it a directory?) The others list the permissions for  you (the owner)  your “group”  the “world” (everybody else)

11 Reading the permissions Columns 2 through 4 are for you Columns 5 through 7 are for your group Columns 8 through 10 are for the world A letter means you have that permission A dash means you don’t Examples:  -rw-r--r--  drwxr-xr-x

12 Some information Directories must be executable and readable to be entered You must have world read permissions set  for the grader to grade  for the world to browse

13 How do I set permissions? Use the command: chmod Where is a three digit number encoding the new permissions  The first digit is for you, the second for your group, and the third for the world

14 What are the numbers? Each number is 0 through 7 that is sum of three  read: 4  write: 2  execute: 1 Some important numbers:  7: read, write, execute  6: read, write, not execute  5: read, execute, but not write  4: read but neither execute nor write  0: neither read, write, nor execute

15 Examples chmod 644 myfile.html  Allows you to read and write and the world to read but not write  Use this for all your Web pages chmod 755 html/  Do this from your home directory  Allows you to read, write, execute  Allows everyone else to enter, read but not write  Use this for all your homework directories

16 Another example chmod 600 myfile.html  Gives you read, write  Shuts off file to the world

17 Using a Linux Editor Some popular editors: emacs, vi, pico, etc Example of using pico  In command line, type pico  Type in the codes of the html file  Type control-o and then a file name to save to a file  Type control-x to exit  Check other pico commands online Here is a list Here

18 Lists One advanced text based structure and often used to  Set out big ideas  Display the table of contents  List links, etc Three kinds of lists:  Ordered  Unordered  Definition lists

19 Ordered lists Used to specify a sequence of things  top-ten list  set of instructions  outline Begun and ended with Each element in the list is Example:  Orderedlist1.html Orderedlist1.html

20 Attributes for ordered lists We can set two attributes  The type of symbols used Arabic numerals (type=1, default) capital or lower case letters (type=A or type=a) capital or lower case Roman numerals (type=I or type=i)  The start value Example:  Orderedlist2.html Orderedlist2.html Note: these attributes can be controlled better through CSS

21 Unordered lists Used for more general collection of items  list of links  ingredients for a recipe rather than instructions Attribute type could be: disc, circle, square Example  unorderedlist.html unorderedlist.html

22 Definition lists Used for definitions and long descriptions Uses tag to begin and end list Rather than using to denote list items, has terms and definitions  Example: definitionlist.htmldefinitionlist.html

23 Nested List Lists can be nested within other lists  The indent from the left is cumulative, however  The deeper you go, the thinner the indent margin will become Example: nestlist.htmlnestlist.html

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

25 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

26 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

27 Including the file src attribute specifies the image file and 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

28 Image alignment The align attribute  To control over the alignment of images with the surrounding text since the default alignment is typically ugly  “ 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

29 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

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

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

32 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

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

34 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: photoshop, GiFFY, convertGiFFY

35 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 Examples  transparent-background.html transparent-background.html  transparent-foreground.html transparent-foreground.html

36 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

37 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

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

39 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

40 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 ??

41 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

42 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

43 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

44 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

45 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

46 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

47 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

48 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

49 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

50 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

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

52 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

53 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

54 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

55 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