1 (X)HTML (eXtensible HyperText Markup Language).

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

Web Development & Design Foundations with XHTML
HTML: HyperText Markup Language Hello World Welcome to the world!
HTML/XML XHTML Authoring. Creating Tables  Table: An arrangement of horizontal rows and vertical columns. The intersection of a row and a column is called.
1 Lecture #5 Static Web Documents Shimrit Tzur-David HAIT Summer 2005.
HTML and XHTML Controlling the Display Of Web Content.
Markup Languages Controlling the Display Of Web Content.
Unit 2, cont. September 14 HTML,Validating your pages, Publishing your site.
1 (X)HTML (eXtensible HyperText Markup Language).
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
Database-Driven Web Sites, Second Edition1 Chapter 2 INTRODUCTION TO HTML.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
XP Tutorial 5New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) HTML Basics James Wang.
DAT602 Database Application Development Lecture 14 HTML.
_ HTML, XHTML & CSS Sami Niemelä | Module 1: Introduction to digital media: Day 02.
HTML (HyperText Markup Language)
(X)HTML (eXtensible HyperText Markup Language)
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML Pt. 2.
HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.
Chapter 1 XHTML: Part I The Web Warrior Guide to Web Design Technologies.
Using Html Basics, Text and Links. Objectives  Develop a web page using HTML codes according to specifications and verify that it works prior to submitting.
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.
Website Development & Management Creating Web Pages CIT Fall Instructor: John Seydel, Ph.D.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
CP476 Internet Computing Lecture 7 HTML 1 What is HTML? HyperText Markup Language (HTML) is an application of Standard Generalized Markup Language (SGML)
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
1 HTML – HyperText Markup Language Representation and Management of Data on the Internet.
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.
Chapter 2 XHTML: Part II The Web Warrior Guide to Web Design Technologies.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
HTML: Hyptertext Markup Language Doman’s Sections.
XHTML 1.1  Derived from Standard Generalized Markup Language (SGML) of ISO  XHTML concerned primary with content rather than presentation and style 
XHTML1-1 Extensible HyperText Markup Language (XHTML) Part 2 Xingquan (Hill) Zhu
ITCS373: Internet Technology Lecture 5: More HTML.
Introduction HTML (Hypertext Markup Language) is used to create document on the World Wide Web. HTML is not a programming language, it is a markup language.
Tutorial 8 Designing a Web Site with Frames. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore the uses of frames.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Creating XHTML Documents Essentials for.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 2.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
Web Development & Design Foundations with XHTML Chapter 2 HTML/XHTML Basics.
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,
1 HTML Frames
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 2.
CSE 409 – Advanced Internet Technology 1 DISCUSSION OF BASIC HTML TAGS.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Basic Document Structure.
HTML Forms.
HTML HYPER TEXT MARKUP LANGUAGE. INTRODUCTION Normal text” surrounded by bracketed tags that tell browsers how to display web pages Pages end with “.htm”
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with 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.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
1 HTML: HyperText Markup Language Representation and Management of Data on the Internet.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
INT222 – Internet Fundamentals
CIS 228 The Internet Day 2, 9/1/11 Hypertext. The Course Instructor: Bowen Alpern Office hour: GI 137-I, 4-5pm Tu.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
HTML for web designing short course. What is an HTML File? HTML stands for Hyper Text Markup Language An HTML file must have an htm or html file extension.
COM621: Advanced Interactive Web Development Lecture 1 – XHTML.
Tutorial 8 Designing a Web Site with Frames
Tutorial 8 Designing a Web Site with Frames
1 Introduction to XHTML.
Lesson 2: HTML5 Coding.
Presentation transcript:

1 (X)HTML (eXtensible HyperText Markup Language)

DBI 2008 HUJI-CS 2 What is HTML? A Markup Language for representing documents –text (data) –structure –appearance –functionality Designed for writing Web pages Traditionally rendered by Web browsers –Nowadays, also by help components, about windows, messengers, clients... anything for which an HTML renderer is powerful enough – replaced RTF in many of these

DBI 2008 HUJI-CS 3 Capabilities of HTML Content presentation –Structures, e.g., paragraphs, lists, tables, etc. –Decorations, e.g., fonts, images, etc. Declaration of meta information –e.g., the page title, language, etc. Linkage to other pages –i.e., attaching links to components Management of user input –e.g., searching, making reservations, ordering products Directions for browsers –e.g., refresh, redirect, caching control, etc.

DBI 2008 HUJI-CS 4 An HTML Page Hello World Wide Web! A simple HTML page Filename ends with.htm or.html

DBI 2008 HUJI-CS 5 HTML Version History HTML 1.0 (first draft) – 1992 HTML 2.0 (proposed standard) – September 1995 From this point on - W3C recommendations HTML 3.2 – January 1997 –added tables, applets,... HTML 4.0 – December 1997 –improved tables, forms,...

DBI 2008 HUJI-CS 6 HTML Version History (cont’d) HTML 4.01 – December 1999 –Slightly different from 4.0 XHTML 1.0 – January 2000 –Reformulation of HTML 4.01 as an XML application –Stricter and cleaner syntax, formatting moved to CSS XHTML 1.1 – May 2001 –“Modularization of XHTML” Our Examples Read more about The History of HTMLThe History of HTML

DBI 2008 HUJI-CS 7 (X)HTML Support in Real Life Non-standard / mixed HTML –Most of the time, will display more-or-less as expected, on most browsers, but its appearance may vary between browser types and between browser versions Even when using completely valid and standard HTML, always check your pages on more than one browser type –At least IE & some Mozilla Your assignments will only be checked on Mozilla SeaMonkey

DBI 2008 HUJI-CS 8 An HTML Page Hello World Wide Web! Basic HTML Syntax (X)HTML contains text, separated by tags Tags come in pairs: opening and closing tag Tags can have attributes, which have values

DBI 2008 HUJI-CS 9 An HTML Page Hello World Wide Web! Basic HTML Syntax (cont) An HTML page is surrounded by the html tag 2 Basic parts: –head: general information about the document (e.g., title – shown on the browser bar) –body: the content of the document Actually a tree structure is created

DBI 2008 HUJI-CS 10 XHTML Stricter Syntax Element and attr. names must be in lower case –HTML allows any case combination, e.g.,, which conveniently helped distinguish tags from the body text All tags must have corresponding closing tags –Use as a shorthand for Elements should be properly nested –e.g., hello world is illegal! Attribute values must be quoted –e.g., and not Line break

DBI 2008 HUJI-CS 11 Document Type Definitions You should specify which XHTML standard you are using Put a document type definition (DTD) at the first line of your file (before the html tag) For an example, see the next slide

DBI 2008 HUJI-CS 12 Document Type Definitions (cont) XHTML - strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " XHTML - transitional (loose) XHTML - frameset (for using frames) Transition html  xhtml: allows some legacy formatting outside CSS

Text: Structures and Decoration

DBI 2008 HUJI-CS 14 Basic Structures In principle, all body elements must reside in structures such as the ones below Heading:, …, –h1 is the most important Paragraph: Quotation block: –separated and indented block

DBI 2008 HUJI-CS 15 Structure Example This is the main header And this is a secondary header This is paragraph 1. This is a new line. This is paragraph 2. The following is quoted from W3C:...

DBI 2008 HUJI-CS 17Lists Ordered (numbered) list: Unordered list: List item: Lists can be nested –That is, one list can reside in an item of another

DBI 2008 HUJI-CS 18 A List Example Item 1 Item 2 Item 3 Item A First inner item Second inner item Item B Item C

Numbers were added implicitly

DBI 2008 HUJI-CS 20Tables Define a table using the tag –Use attributes to specify the border weight, cell-padding, etc. A table contains rows: Each row contains data cells: –May contain text, images, lists, tables, etc. For heading cells use: Many use tables for page reformatting

DBI 2008 HUJI-CS 21 A Table Example Item A Item B Item C empty cell

DBI 2008 HUJI-CS 22 Text Formatting Formatted text: – bold – italic – big small Preserve spaces and line breaks:... –Outside this tag, any positive amount of white space characters is considered as one space character –Text consisting solely of white spaces is completely ignored Line break: Horizontal ruler:

DBI 2008 HUJI-CS 23 An Example Formatting Example There is bold text and italic text. There are big characters and small characters.

DBI 2008 HUJI-CS 24 An Example (cont) Some preformatted text: A B C D E F G

Hyperlinks

DBI 2008 HUJI-CS 26 Basic Links Basic form: linked-fragment For example: Google The linked fragment should contain only inline elements –e.g., text, images,,, etc.

DBI 2008 HUJI-CS 27 Link Targets The target URL can be absolute google Or relative to the folder of the page Exercise 1 Or relative to the server DAST When should we use complete paths? When should we use relative paths? What will be the target URL if the link is at

DBI 2008 HUJI-CS 28 Anchors / References Using anchors, you can define hyperlinks between components in the same page To define an anchor, use: anchored-fragment –name="anc_name" will also work To link to an anchor, use: linked-fragment Of course, you can add an (absolute or relative) URL before the anchor

DBI 2008 HUJI-CS 29 More Hyperlinks Newsgroup Connect to the Library This is not a closed list! Many protocols are constantly emerging (e.g., ed2k://, which links to an interesting technology which we will not discuss) or fading away (e.g., gopher://, which lost the battle against http/html for being too strict and lacking in graphics support)

Forms

DBI 2008 HUJI-CS 31Forms Forms enable users to pass parameters to applications on the WEB For example, search queries, credit-card numbers for online commerce, etc.

DBI 2008 HUJI-CS 33Forms A form has the following structure: The method is either get or post (remember the difference? Hint: request content) The URL specifies the application that processes the form parameters HTML with Form Widgets (assignments to form parameters)

DBI 2008 HUJI-CS 34 Forms (cont’d) Each widget is associated with a parameter (the widget’s name), and its value is determined by the user of the browser One of the widgets is often a submission button –Submission can also by applied by other means, e.g., pressing the "enter" key, choosing an item, etc. Upon submission, all the parameter values are sent to URL (HTTP req.) and a new page (i.e., the HTTP res.) is loaded HTML with Form Widgets (assignments to form parameters)

DBI 2008 HUJI-CS 35 An Example: Search Google Type the search term: The sent data will be something like : q=blabla

DBI 2008 HUJI-CS 36 Input Widgets Text area: Favorite course: Password area: Password: Initial value The password is hidden while typing, but is sent as unencrypted plain text. If the “ get ” method is used, it is also visible in the URL box!

DBI 2008 HUJI-CS 37Checkboxes milk sugar cocoa Unchecked options are not sent In our case, all of the checked options be assigned as values of the same variable Default value Sent data is something like: incoffee=sugar& incoffee=milk&...

DBI 2008 HUJI-CS 38 Radio Buttons Gender: female male Only a single option CAN be checked. If there is a default option, then EXACTLY one option MUST be checked. Sent data is something like : gen=f

DBI 2008 HUJI-CS 39Menus apples <option value="b" selected="selected">bananas The number of visible items in the drop-down list Only a single item can be selected Sent data is something like : fruit=b

DBI 2008 HUJI-CS 40Menus <select name="vegetable" size="2" multiple="multiple"> tomato cucumber lettuce carrot Multiple choices can be made Sent data is something like : fruit=tomato&fruit=carrot

DBI 2008 HUJI-CS 41 Text Areas Write a story: Default text...

DBI 2008 HUJI-CS 42 Sending Entire Files Upload your image:...other form widgets... Some browsers send to the server not only the file, but also its complete absolute path on your FS! Why is this bad? RFC1867 probably only meant for relative file names to be sent – Why is it a good idea to send any part of the file name at all?

Frames

DBI 2008 HUJI-CS 44 A Common Usage of Frames

DBI 2008 HUJI-CS 45 Instead of a “body”, the document has a “frameset” element Size and number of frames is determined by the attributes “cols” and “rows” Size can be specified relatively (e.g., 50%), by number of pixels (e.g., 70), or by “remaining size” (*)Framesets We ’ ll see an example later …

DBI 2008 HUJI-CS 46Frames Within frameset elements, there can be frame elements, nested frameset elements and a noframes element A frame can have the attributes: –src="url": the url to be displayed in the frame –name="window_name": name – used for targeting –scrolling="yes|no|auto": auto is default In a noframes element, put alternative content for browsers that don’t support frames (how do these (old) browsers “know” they should display this content?)

DBI 2008 HUJI-CS 47 A Frameset Example Frames Example

DBI 2008 HUJI-CS 48 Links in Frames In a link, the target attribute can specify where the new page will be opened –target="frame-name": in the specified frame –target="_self": in the frame where the link is –target="_top": in the whole window –target="_blank": in a new window of the navigator This attribute is disallowed in the strict DTD! (But do not despair! there is a corresponding feature in JavaScript)

DBI 2008 HUJI-CS 49 Inline Frames Inline frames are embedded in regular HTML content In transitional XHTML, this is done using the iframe tag In strict XHTML, we use the object tag

DBI 2008 HUJI-CS 50 Inline Frame Example Here are two Web pages: Your browser does not support this object! Your browser does not support this object! Do you know these pages?

DBI 2008 HUJI-CS 52 Avoid Using Frames! Usage of frames poses some serious problems –Unidentified Web pages Namely, a page comprises a combination of pages in frames, and it is not identified by a URL For example, bookmarking is a problem Moreover, you cannot provide a link to a page in the site –Troubles to search engines Namely, the search engine does not understand which combinations of frame pages are meant to be, while such combinations can be relevant to the keywords… –Considered “old-fashioned” Web design –and more Hence, frames are considered wrong page design Instead, use CSS layout properties (next lecture)

No Frames!

Miscellaneous Issues

DBI 2008 HUJI-CS 55Entities There are entities that replace special symbols: –Space: –<: < –>: > –&: & Why are these entities defined? 1<2 & 3>2.

DBI 2008 HUJI-CS 56 The meta tag adds information about the page –Used by browsers, search engines and other applications Examples: The Tag Some other popular tags include robots directives Don ’ t use cache if expired …

DBI 2008 HUJI-CS 57 Images can be added to a page using the img tag An image can be used as a link Images A short description of the image – required!

DBI 2008 HUJI-CS 58 A picture is divided into several areas, each area linking to a different place: Image Maps Left, top, right, bottom X1,y1,x2,y2, … Either clockwise or counter-clockwise centerX,centerY, radius Order matters! When a pixel is clicked, the data in the first area containing it is used! See also: the nohref attribute

DBI 2008 HUJI-CS 59 Remarks / Comments Remarks are totally ignored during rendering Use to insert a remark Remarks can include other tags: –e.g., bold but remarked --> Do not use -- in remarked text! (why?)

DBI 2008 HUJI-CS 60 Page Validation You can validate the compliance of your page with the specifications using the validation service of W3C at validator.w3.orgvalidator.w3.org Do not forget to add the appropriate DTD declaration and the content-type meta header If you pass validation, you will have earned the privilege of adding the precious W3C icon to your page