Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Relative Pathnames Often links refer to other Web pages on the same site.

Slides:



Advertisements
Similar presentations
Introduction to Web Design Lecture number:. Todays Aim: Introduction to Web-designing and how its done. Modelling websites in HTML.
Advertisements

Computers: Tools for an Information Age Writing Your Own Web Page: Using HTML and Web Authoring Tools.
HTML popo.
CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Cascading Style Sheets
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Chapter 4 Marking Up With Html: A Hypertext Markup Language Primer.
Chapter 4 A Hypertext Markup Language Primer. Learning Objectives Know the meaning of and use hypertext terms Use HTML tags to structure a document Use.
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
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.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
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.
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
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.
Spring 2013 CS 103 Computer Science – Business Problems Lecture 7: A Hypertext Markup Language (HTML) continue Instructor: Zhe He Department of Computer.
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.
.  Entertain  Inform  Educate  Blogs  Sell  Date  Gamble  Religion.
HTML H yper T ext M arkup L anguage. HTML HTML is NOT case sensitive However, proper coding etiquette if for all to be in ALL CAPS and for text to be.
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) –
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Introduction to Computers CS Dr. Zhizhang Shen Chapter 4: Talking.
1 Basic HTML. 2 Part 1: Basic Web Page Production.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
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.
C1999 Kathleen Schrock 1 Basic HTML By Kathy Schrock.
XP Mohammad Moizuddin Creating Web Pages with HTML Tutorial 1 1 New Perspectives on Creating Web Pages With HTML Tutorial 1: Developing a Basic Web Page.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
HTML, Part Showing Pictures: The Image Tags Image Tag Format –src short for source –alt for text –Can use absolute or relative pathname.
Programming in HTML.  Programming Language  Used to design/create web pages  Hyper Text Markup Language  Markup Language  Series of Markup tags 
Introduction to HTML. What is HTML? Hyper Text Markup Language (HTML) is a language for describing web pages. HTML is not a programming language, it is.
CPT 123 Internet Skills Class Notes Publishing to the Web Session B.
1 Web Developer Foundations: Using XHTML Chapter 4 Key Concepts.
Adobe Dreamweaver CS3 Revealed CHAPTER THREE: WORKING WITH TEXT AND IMAGES.
HTML: Hyptertext Markup Language Doman’s Sections.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Adding Graphical Elements Essentials for.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley A Hypertext Markup Language Primer Marking Up with HTML lawrence snyder c.
Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley What did we learn so far? 1.Computer hardware and software 2.Computer block.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
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.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Macromedia Dreamweaver 8 Revealed AND GRAPHICS WORKING WITH TEXT.
HTML Primer. A very good set of tutorials and references for HTML “Try it” feature lets you type in HTML.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
HTML Chapter 4 Source: CSE 190 M (Web Programming) lecture notes, es/slides/lecture02-basic_xhtml.html.
What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup.
Writing Your Own Web Page: Using HTML and FrontPage Chapter 10.
REEM ALMOTIRI Information Technology Department Majmaah University.
`. Lecture Overview HTML Body Elements Linking techniques HyperText references Linking images Linking to locations on a page Linking to a fragment on.
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
HTML Basics.
Showing Pictures: The Image Tags
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
Introduction to HTML.
Chapter 4: Marking Up With HTML: A Hypertext Markup Language Primer
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:

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Relative Pathnames Often links refer to other Web pages on the same site These pages are all be stored in the same or nearby folders These anchor tags use relative pathnames A relative pathname describes how to find the referenced file relative to the file in which the anchor tag appears

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Going “Deeper” in a Folder When the file containing the anchor and the referenced file are in the same folder— we just give the file name Russell When the referenced file is “deeper” in the directory, we simply give the path from the current folder down to the file Russell

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Going “Higher” in a Hierarchy But, what about moving higher up in the hierarchy This is a UNIX operating system technique Navigating up to another folder: add../ to the beginning of the href attribute Russell Each../ moves up one level higher in the hierarchy

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Structure of the Image Tag An image tag specifies a file that contains an image: src is the abbreviation for “source” filename uses the same rules for absolute and relative pathnames as anchor tags alt value specifies an alternative form for the image, usually a textual description

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Structure of the Image Tag The alt tag was introduced to assist persons who are visually impaired Screen readers don’t know what the image is, but they can read the description of the alt tag HTML requires alt tags (?) When an image is not available or loads slow, browsers display the alt information

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley GIF and JPG Images Images can come in several formats Web pages tend to use two of them: –GIF (pronounced is jif ) (Graphics Interchange Format) best suited for cartoons and simple drawings –JPEG (pronounced JAY·peg) Joint Photographic Experts Group appropriate for high-resolution photographs and complex artwork

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley GIF and JPG Images PNG are newer forms of GIF and can also be used on Web pages PNG stands for Portable Network Graphics format To tell the browser which format the image is in, the file name should include one of these extensions:.gif,.png,.jpg, or.jpeg

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Making an Image Link We do not have to use text as the anchor Images can be used as well Combine an anchor tag with an image tag: When the page displays, the usual highlighting that links receive will be used to mark the.gif as a link

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Attributes –An additional specification included inside a tag –The abbreviations href, src, and alt are attributes –Attributes have the form name="value" the name, such as href, is the attribute the text in quotes, such as, biographies/russellbio.html, is the value Values are always enclosed in quotes

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley The Style Attribute The style attribute is the most useful attribute Used to control a huge list of properties for every feature of a Web page –Properties are characteristics of page components, such as color, size, or position. The value of the style has a standard form: style = "property_name : specification"

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley The Style Attribute style = "property_name : specification" The colon (:) separates the property name from its specification The spaces on each side of the colon are optional Notice that when more than one property is set with style, the name/specification pairs are separated by a semicolon (;)

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley For colors, go to

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Attributes for Image Tags The attributes width and height of the image tag can be used to specify the size of an image The photo puffer.jpg will appear as 200 × 200 pixels, even if the actual size of the photo is 2000 × 2000 Specify only the width or the height of an image

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Attributes for Image Tags The browser will shrink that length or width dimension of the image by some factor f The browser will automatically reduce the other dimension by the same factor f, producing a smaller picture Take care in specifying both width and height Images can become distorted if f is not consistent for both width and height

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Styling Position for Images Images are inserted in the page at the point in the text where the tag is specified in the HTML, and the text lines up with the bottom of the image Messy? Hard to read? A better way to place images in text is to flow the text around them

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Styling Position for Images You can either by positioning the image on the left with the text to its right, or vice versa To make the text flow around the image, use the style attribute in the image tag with the value "float:left" or "float:right" To display an image without any text around it, enclose it in paragraph tags

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Span What if there is no tag to add a style attribute? Use the tag ’s only job is to surround text, and provide a place for style and other attribute information My favorite fonts are Helvetica, Century Gothic, and Bodoni.

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Applying Style to Improve our Paradox Page  Add links with local path names to our own bios  Special background and text colors  Color change on the “This sentence is false” text  New color styling for the headings  The horizontal line has been shortened to 75 percent of the browser window width, centered  Added an image, put it to the right side, and flowed text around it to the left

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Cascading Style Sheets (CSS) Cascading Style Sheets (CSS) are responsible for much of the design of Web pages It is a general styling system for documents that simplifies the task of creating complex page designs

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Setting Global Style Repeating style information wherever it is needed can be time-consuming and tedious It can be placed in one global location inside the It then applies to the whole page Place the style information inside a pair of and tags

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Setting Global Style The tag contains a type attribute specifying the form of the style Within the and are specifications for each tag that should have its properties adjusted The general syntax is elem_name { prop_name1 : value1 ; prop_nameN : valueN }

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Setting Global Style The text between the tag’s angle brackets, known as the tag element, is given by the element name When styling a particular tag, use the name only, we are not allowed to use the brackets here After the element name and inside curly braces ({}) is the list of property—value pairs separated by semicolons

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Setting Global Style For each value pair, the property is separated from its value by a colon Now, all occurrences of the tag will be styled with these properties A document can be now given a consistent look without having to repeat the styling information every time a style tag is used

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

In Styling, Closest Wins What if you want an exception to the rule? What if you want the to look different for one heading? Just style that specific tags with the style attribute The basic style is given globally, a specific style is given locally or at that point in the Web page

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Adding Class to Style If a tag should be styled in several different ways, then there are several different classes of styling A class is a family of styling specifications with a common name The class is given in two places: –In the style definition inside the style tags in the –At the site in the HTML code when the code is used

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Adding Class to Style... For the style definition, we append the class name (scientist) to the tag with a dot: h2.scientist Plain tags are styled with those features that apply to all tags Each separate class gives additional styling specifications

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Style from Files To reuse the style information for multiple works, all of the style information is placed inside a separate file The browser is told where the style information is by using a tag in the : This ensures that a whole site is styled consistently

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Moving Style to a File Place the global style specification into a file as a sequence of elements and their property/specification pairs Don’t include the tags! The style file should be plain ASCII text The file extension should be.css Moving the style out shortens the section of the HTML

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Cascading the Style Sheets CSS uses the rule “closest style wins” There are 5 levels of styling information: 1.Default, given by browser settings 2.External, given in a file 3.Global, given in the section 4.Range, given in an enclosing tag 5.Site, given by the style attribute

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Cascading the Style Sheets Each level is broader and more general than the level below it However, there’s a rule: the closest style wins! This idea of progressively becoming more site specific is the “cascading” behind Cascading Style Sheet It allows general styles to be adopted at various levels and overridden later

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Lists Tags The easiest type of list is the unordered list Unordered list tags and surround the items of the list The items are enclosed in list item tags, and

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Lists Tags Another list is the ordered list It uses the tags and Bullets are replaced with numbers The ordered list behaves just like the unnumbered list

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Lists Tags You can also have a list within a list Make a sublist within the main list Notice that sublists use a different bullet symbol

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Lists Tags The definitional list Indicated by the and tags Definitional lists are made of: –Definitional terms surrounded by and –Definitional data surrounded by and

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Handling Tables A table is a good way to present information. It’s like defining a list of lists –The main list items, called rows, has one or more items, called cells The browser aligns cells to form columns

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Handling Tables The table is enclosed in and The table can have a border, if you use the border attribute Each row is enclosed in and Cells are surrounded by table data tags, and

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Handling Tables You can give tables captions and column headings: Place caption tags within the table tags around the table’s caption –caption tags are and Captions are centered at the top of the table

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Handling Tables Column headings are the first row of the table In the “heading” row, replace the table data tags with table heading tags and Column headings display in bold

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Pseudo Classes There are properties to change the style of links The default is for links to be blue and underlined Style the anchor tag: a:link {color : darkviolet; text-decoration : none} a.me:link {color : gray; text-decoration : none} a:hover {color:red}

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Pseudo Classes These styles are slightly different from the other tags The anchor tag has several different states that can be styled separately These states are referred to as pseudo classes The three main states are link, hover, and visited

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Pseudo Classes link: the style for an unvisited link hover: the style for when the cursor hovers over a link visited: the style for links that have been visited

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Summary Recall the idea of using tags for formatting: –A working set of HTML tags, giving you the ability to create a Web page. –An explanation of how links are marked with anchor tags. – Absolute and relative pathnames. Relative pathnames refer to files deeper or higher in the directory hierarchy. –The two most popular image formatting schemes and how to place them in a page. –Cascading Style Sheets, a general system for styling Web documents. –Lists and tables.

Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Summary