Web-based Application Development Lecture 4 January 19, 2005 Anita Raja.

Slides:



Advertisements
Similar presentations
HTML popo.
Advertisements

XHTML Week Two Web Design. 2 What is XHTML? XHTML is the current standard for HTML Newest generation of HTML (post-HTML 4) but has many new features which.
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.
Creating Pages in XHTML
XHTML Basics.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
Chapter 8 Creating Style Sheets.
1 eVenzia Technologies Learning HTML, XHTML & CSS Chapter 1.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 3: XHTML Coding © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page.
Site Development Foundations © 2004 ProsoftTraining All rights reserved.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
HTML Hypertext Markup Language –First proposed by CERN in 1989 –It is non-linear so it allows you to jump from place to place –Markup refers to the structure.
Web-based Application Development Lecture 9 February 7, 2006 Anita Raja.
Cascading Style Sheets (CSS) Why do we need them? Separate structure from browser presentation There are many HTML presentation attributes –We want to.
XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.
Web-based Application Development Lecture 5 January 24, 2006 Anita Raja.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.
HTML: PART ONE. Creating an HTML Document  It is a good idea to plan out a web page before you start coding  Draw a planning sketch or create a sample.
© Ms. Masihi 1.  A web page is created using a language called, Hypertext Markup Language, better known as HTML Code.  HTML is a user friendly language.
CSS The Definitive Guide Chapter 6.  Text is the content, and fonts are used to display that content. By using text properties you can affect the position.
HTML Notes Chapters 1--6 Codes used in creating HTML documents are called tags. Tags are always enclosed in left ( ) angle brackets. Tags can be upper.
Creating a Simple Page: HTML Overview
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Creating a Basic Web Page
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Cascading Style Sheet (CSS)
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
Essential Tags Web Design – Sec 3-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Tutorial 1 Developing a Basic Web Page. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives – Lesson 1 Introduction to the.
CS134 Web Design & Development Creating a Basic Web Page Mehmud Abliz.
Chapter 1 XHTML: Part I The Web Warrior Guide to Web Design Technologies.
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
CSCE Chapters 1 and 2 CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department of Computer Science & Engineering.
1 Web Developer Foundations: Using XHTML Chapter 2 Key Concepts.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
CASCADING STYLE SHEETS. Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
A Basic Web Page. Chapter 2 Objectives HTML tags and elements Create a simple Web Page XHTML Line breaks and Paragraph divisions Basic HTML elements.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
HTML: Hyptertext Markup Language Doman’s Sections.
ECA 228 Internet/Intranet Design I Intro to Markup.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Creating XHTML Documents Essentials for.
Web Development & Design Foundations with XHTML Chapter 2 HTML/XHTML Basics.
1 Web Application Programming Presented by: Mehwish Shafiq.
Lecture: Web Design Assis. Prof. Freshta Hanif Ehsan Faculty of Computer Science Kabul Polytechnic University Spring Semester
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
HTML Basics Computers. What is an HTML file? *HTML is a format that tells a computer how to display a web page. The documents themselves are plain text.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
CSCE Chapter 3 (Cascading Style Sheets) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department of Computer.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
Formatting Text with HTML and CSS. Summary block-level elements. Character-level elements Logical and physical style Special elements: hr,address, quotation.
NOTEPAD++ Lab 1 1 Riham ALSmari. Why Notepad++ ?  Syntax highlighting  Tabbed document interface  Zooming  Indentation code  Find and replace over.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Lesson 5. XHTML Tags, Attributes and Structure XHTML Basic Structure head and body titles Paragraph headings comments Document Presentation Manipulating.
Programming the Web using XHTML and JavaScript
Programming the Web using XHTML and JavaScript
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Lesson 2: HTML5 Coding.
Presentation transcript:

Web-based Application Development Lecture 4 January 19, 2005 Anita Raja

Agenda from TA Creating a Basic Web Page (concluded) PTW Chapter 2 Cascading Style Sheets PTW Chapter 3

The HTML Source Document Page content goes here Page Title

The HTML Source Document Ch02-Ex-03

The HTML Source Document Use plain-text editors (Notepad) Other types of editors (like MS WORD) use hidden formatting codes Filename.htm (or.html) No spaces (underscore character instead) Enclose in quotes when using Notepad File – Open … Drag icon into open browser window

HTML, XML, and XHTML Writing HTML code: Indent Nest properly

HTML, XML, and XHTML Chapter 2 Chapter 2 Correct Incorrect

HTML, XML, and XHTML Browsers: Evaluate from the top down Ignore whitespace Tabs, extra spaces, line breaks Make your HTML code easily read by humans Ch02-Ex-03 but without human formatting Ch02-Ex-03 Does HTML code have to be lower case?

HTML, XML, and XHTML Browsers developed along diverging paths Netscape Explorer Features were added – not always in the same way W3C created Create an “official” version of HTML

HTML, XML, and XHTML PCs – not much of a problem Handheld devices – HUGE problem Need: A standardized version of HTML Compatible with all types of devices PCs, handhelds, others? HTML development stopped at V4

HTML, XML, and XHTML XML – Extensible Markup Language Specifies a universal, structured format Data is classified by its meaning Users could create custom tags Car dealer: Very strict syntax rules ensure universality Case matters!

HTML, XML, and XHTML XHTML – Extensible HTML Official release January 2000 XHTML is not XML but it is based on XML Inherits rules and benefits of XML Thus, XHTML is case-sensitive: ≠ ≠ ≠ Why?

HTML, XML, and XHTML Exceptions imply complexity Software cannot be written simply It must account for each exception individually Programs must therefore be larger and more difficult to maintain Complexity requires Additional processing (slower) an More memory (larger and more expensive)

HTML, XML, and XHTML How to make HTML into XHTML? Before add: <!DOCTYPE html PUBLIC ¬ “-//W3C//DTD XHTML 1.0 Transitional//EN” ¬ 1 st line: XML Declaration 2 nd line: Document Type Definition

HTML, XML, and XHTML Also, change tag itself: “Tags defined in this document conform to the W3C definitions found at...” Start using the new standards NOW Ch02-Ex-04 XML namespace

HTML, XML, and XHTML tag describes document content Useful for search engines Optional, goes in section Attributes: Name: “keywords”, “description” Content

Paragraphs and Line Breaks Can’t use whitespace to format document HTML uses elements (tags) and only elements to define document’s structure Paragraph tag Classifies a block of text as a paragraph Preceded and followed by a blank line (usually) Can add other attributes (Chapter 3)

Paragraphs and Line Breaks Break tag Generates a line break Without inserting a blank line like the tag. “Empty” tag – no needed instead (space optional) / required by XHTML to indicate an empty element Ch02-Ex-05

Adding More Tags Emphasizing text - italics HTML: This word is italicized Browser: This word is italicized - bold HTML: This word is bold Browser: This word is bold Ch02-Ex-06

Adding More Tags Italics … Bold … Why use or ? and define the presentation (display) and define the structure

Adding More Tags Structure vs. Presentation: so what? In early HTML, designers used tags for both: structure and presentation Problem: Those Web pages display well only on PCs Other devices required other versions of the HTML code. Presentation does not have to be visual!

Adding More Tags By defining structure and presentation separately this problem is eliminated Structure defined by HTML code Presentation defined elsewhere: Browser Style sheet definitions (Chapter 3) This is the point of XHTML

Adding More Tags Block-level elements Define a complete section of text Preceded and followed by a blank line Body, header, paragraph tags Inline elements Apply to a sequence of characters within a block Emphasis and strong tags

Adding More Tags Blocks may contain anything: Other blocks … … … Inline elements … … … Inline elements may contain Other inline elements … … … BUT NOT BLOCKS! … … …

Adding More Tags Font size: … Do NOT use header tags to control the appearance of text This misclassifies the text

Adding More Tags Can fonts be specified directly? Font tag … Defines presentation, not structure Style sheet method is preferred (Chapter 3)

Adding More Tags Who should control appearance? Designer? Surfer? Default is surfer (by controlling browser settings)

Adding More Tags Comments Annotate code Prevent code from being processed

Assignment Debugging Exercise, p. 52 Correct errors Post corrected document to your Web space as “Lagerstrom-Ch-2.html” Grade based on: Appearance Technical correctness of code

Programming the Web using XHTML and JavaScript Chapter 3 Cascading Style Sheets

The Power of Styles Structure and content do NOT equal presentation! Presentation is not meant to be determined by HTML elements Defaults exist = 24-pt, bold, Times Roman Reason: Not all Web pages display in PC browser windows

I’ll bet red headings would look nice

Internal Style Sheets Redefines the presentation rule (style) for certain elements “Internal” because contained within the HTML source document itself Styles may be defined using different style sheet languages so … … the language used must be specified

Internal Style Sheets element in section … The style sheet instructions in this elements are: Written in plain text format Using the cascading style sheet language

Internal Style Sheets Also specify default style sheet language for entire HTML document: elements go in the section

Internal Style Sheets h2 { color:red } Style definition Name of tag Property Value

Internal Style Sheets h2 { color:#D61130 }

Internal Style Sheets Alignment Options are: left, center, right, justify h2 {color:red; text-align:center}

Uh, oh. I need bigger section headings

Formatting Fonts Using Styles Could find & replace all with Why not? What if some had been used for other things?

Formatting Fonts Using Styles Use font-size property: h2 {color:red; text-align:center; font-size:24pt}

Formatting Fonts Using Styles Other choices for font-size value: 150% smaller small, x-small, xx-small larger large, x-large, xx-large

Formatting Fonts Using Styles Use font-style property: Also normal, oblique h2 {… font-style:italic …}

Formatting Fonts Using Styles Other properties text-decoration underline, overline, line-through, blink, none text-transform capitalize, uppercase, lowercase, none font-variant small-caps, none background-color

Formatting Fonts Using Styles Paragraph styles Only works for content enclosed within elements p {font-size:14pt}

Formatting Fonts Using Styles Indent and line spacing: p {text-indent:25pt; line-height:24pt} p {text-indent:12%; line-height:150%}

Formatting Fonts Using Styles Font Families What if not installed on user’s browser? p {font-family:”Lucida”}

Formatting Fonts Using Styles Include more than one font families: p {font-family:”Lucida”,”Arial”}

Formatting Fonts Using Styles Warning: multiple fonts may not have the impact you intend User’s display may not include the fonts you specified Common fonts may be the best choice overall

Formatting Fonts Using Styles Can compress definition p {font-style:italic; font-weight:500; font-variant:small-caps; font-size:14pt; line-height:24pt; font-family:”Lucida”,”Arial”} p {font: italic 500 small-caps 14pt/24pt ”Lucida”,”Arial”}

Assignment Debugging Exercise, p. 81 Correct errors Post corrected document to your Web space as “Lagerstrom-Ch-3.html” Grade based on: Appearance Technical correctness of code