NSWI142 – Web Applications Lecture 2 – HTML Martin Nečaský, Ph.D. Web Applications (NSWI142 ), Lecture 21.

Slides:



Advertisements
Similar presentations
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Advertisements

Neal Stublen Content Models  Metadata content Data not necessarily presented on the page ○ title, link, meta, style  Flow content.
Presenter: James Huang Date: Sept. 26,  Introduction  Basics  Lists  Links  Forms  CSS 2.
A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
Images, Tables, lists, blocks, layout, forms, iframes
Chapter 6 Basic forms 1. Forms and query string 2 form : a group of user input (UI) controls that accepts information from the user and sends the information.
Markup Languages Controlling the Display Of Web Content.
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Table, Forms, Metatags and Frames.
Chapter 14 Introduction to HTML
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Building the User Interface by Using HTML5: Organization, Input, and Validation Lesson 3.
HTML. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is a markup language A markup language.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
HTML 5.0 Technologies for Web Application Development Martin Nečaský Department of Software Engineering, Faculty of Mathematics and Physics, Charles University.
1 HTML References: A HTML Tutorial: /HTMLPrimer.html
HTML (HyperText Markup Language)
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
Web Development University of Khartoum. Web Development Web Programming Web Design University of Khartoum.
 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.
HTML. Basic HTML HTML document – HTML headings – to HTML paragraphs – HTML links – HTML images –
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
INTRODUCTION. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language,
Copyright 2007, Information Builders. Slide 1 Understanding Basic HTML Amanda Regan Technical Director June, 2008.
Chapter 2 XHTML: Part II The Web Warrior Guide to Web Design Technologies.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
XHTML 1.1  Derived from Standard Generalized Markup Language (SGML) of ISO  XHTML concerned primary with content rather than presentation and style 
Forms Collecting Data CSS Class 5. Forms Create a form Add text box Add labels Add check boxes and radio buttons Build a drop-down list Group drop-down.
Martin Kruliš, Martin Nečaský by Martin Kruliš (v1.1)1.
Web Technologies Lecture 3 Web forms. HTML5 forms A component of a webpage that has form controls – Text fields – Buttons – Checkboxes – Range controls.
HTML Forms.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
HTML5 Introduction to Web Programming. Plan of the course HTML5 Structure of a document Main HTML Tags –Headings –Paragraphs –Links –Tables –Forms –Images.
CS3101 Internet Programming. Chapter 01 Introduction to XHTML 2Internet Programming - Chapter 01:XHTML Slides based on: Programming the World Wide Web.
1999, COMPUTER SCIENCE, BUU Introduction to HTML Seree Chinodom
Copyright © Pearson, Inc All Rights Reserved. WEEK 7: INTRODUCTION TO HTML5 Sotiris Charalambous.
2.4. Choose and configure HTML5 tags to organize content and forms Choose and configure HTML5 tags for input and validation. Building the User Interface.
INTERNET APPLICATIONS CPIT405 Forms, Internal links, meta tags, search engine friendly websites.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
TNPW1 Ing. Jiří Štěpánek.  ordered list  (list item)  unordered list  (list item)
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Week 1: Introduction to HTML and Web Design
Creating and Processing Web Forms
HTML CS 4640 Programming Languages for Web Applications
4 Introduction to XHTML.
Elements of HTML Web Design – Sec 3-2
Objectives Design a form Create a form Create text fields
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
The Web Warrior Guide to Web Design Technologies
Chapter 5 Introduction to XHTML: Part 2
Elements of HTML Web Design – Sec 3-2
1 Introduction to XHTML.
Introduction to XHTML Cont:.
Introduction to HTML.
CS3220 Web and Internet Programming HTML and XML Basics
The Internet 10/27/11 XHTML Forms
IS333: MULTI-TIER APPLICATION DEVELOPMENT
HTML5 - 2 Forms, Frames, Graphics.
Web Client Side Technologies Raneem Qaddoura
Web Programming and Design
HTML CS 4640 Programming Languages for Web Applications
Presentation transcript:

NSWI142 – Web Applications Lecture 2 – HTML Martin Nečaský, Ph.D. Web Applications (NSWI142 ), Lecture 21

What is HTML? HTML = Hypertext Markup Language World Wide Web's markup language language for describing the structure of Web pages Web page = semi-structured document with structure denoted in a form of HTML markup Web Applications (NSWI142 ), Lecture 22

What is HTML? Web Applications (NSWI142 ), Lecture 23 Simple web page Simple web page This is a web page with HTML5 markup.

HTML Syntax HTML document consists of a tree of elements and texts – Browsers represent the tree in Document Object Model (DOM) which can be manipulated with JavaScript Web Applications (NSWI142 ), Lecture 24

HTML Syntax Elements have to be nested, they cannot overlap Element can have zero or more attributes – attribute consists of name and value – value is optional – value is optionally enclosed in single or double quotes quotes are mandatory when value contains one of " ' ` Web Applications (NSWI142 ), Lecture 25

HTML Code Analysis in a browser, on a concrete URL? Web Applications (NSWI142 ), Lecture 26

Evolution of HTML Web Applications (NSWI142 ), Lecture 27 HTML 2.0 HTML 3.2 HTML 4.01 XHTML 1.0 XHTML HTML 5 XHTML XML 1.0

Evolution of HTML WhatWG – – "Living Standard" (see Last Updated) W3C – – discuss standardization process stages of a document (draft, CR, R) What is the relationship between WhatWG and W3C? Web Applications (NSWI142 ), Lecture 28

Web of Documents Current World Wide Web is sometimes referred to as Web of Documents Web Applications (NSWI142 ), Lecture 29 HTML as a format for representing documents published on the Web URLs as unique global identifiers of documents HTTP for localization and accessing documents by their URLs Hyperlinks between documents to link related documents on the Web

HTML Markup Web Applications (NSWI142 ), Lecture 210

Hyperlinks  links to resources which are exposed to user of current document to navigate to those resources  two forms – Google attribute href specifies URL of linked resource content is visible to user (may be text or any inline HTML element) – … attribute id specifies identifier which can be linked from other places of the same document... – …... or from other documents – … 11

HTML Body Markup (HTML5) text level semantics elements – enable to denote parts of the text in a HTML document with a specific semantics sectioning content grouping content tables, forms images hyperlinks generic constructs Web Applications (NSWI142 ), Lecture 212

Text Level Semantics Web Applications (NSWI142 ), Lecture 213 ElementDescription em Represents stress emphasis of its content. The level of stress is given by the level of nesting of particular em elements strong Represents strong importance of its content. small Represents a side comment. s Represents no longer relevant or accurate content. cite Represents a title of a work (book, article, game, software, song, opera,...). abbr Represents an abbreviation or acronym, optionally with its expansion in title attribute. data Represents its content enriched with its machine readable notation in value attribute. time Represents its content which is a determination of time with machine readable notation in datetime attribute. i Represents its content in a manner indicating different quality of text b Represents its content to which attention is being drawn br Represents a line break

Sectioning Content content of document is divided into sections sections are divided to subsections section element – generic section article element – self-contained section – independently distributable and reusable – e.g. blog post or newspaper article aside element – denotes section related to content around and is considered separate around that content – e.g. did-you-know aside box nav element – denotes section with navigation links

Sectioning Content This article summarizes technologies... HTML CSS We will start with HTML. First, we will go to history. Then, we will deal with actual 5.0. Did you know that SGML is a predecessor of HTML? CSS is the second technology. Home Contact Another article

Section Headers and Footers header element – distinguishes header of the nearest section (hierarchically) – intended (but not required) to contain heading ( h1 – h6 ) footer element – distinguishes footer of the nearest section (hierarchically)

Sectioning Content NSWI117 – Summary of technologies HTML We will start with HTML. Home Contact

Section Headings h1 – h6 element – heading of nearest section – number gives relative rank – hM has higher rank than hN if one of the following is true M < N and hM and hN are in the same section hN is in subsection of section of hM – hM has the same rank as hN iff they are both from the same section and M = N hgroup element – heading of nearest section – groups a set of h1 – h6 elements when heading has multiple levels (e.g. heading with subheadings or alternative titles)

Section Headings NSWI Summary... At this page,... HTML About HTML... HTML History HTML Today CSS About CSS... 1.NSWI117 - … 1.HTML 1.HTML History 2.HTML Today 2.CSS

Section Headings NSWI Summary... At this page,... HTML About HTML... HTML History HTML Today CSS About CSS... 1.NSWI117 - … 1.HTML 1.HTML History 2.HTML Today 2.CSS

Section Headings NSWI Summary... At this page,... HTML About HTML... HTML History HTML Today CSS About CSS... 1.NSWI117 - … 1.HTML 1.HTML History 2.HTML Today 2.CSS

Grouping Content 22 ElementDescription p Represents a paragraph pre Represents a block of preformatted text div Element with no special meaning. It is just a block of text. main Represents a block with a dominant content of another block. ul Represents an unordered list ol Represents an ordered list li Represents a list item

List Example First item Second item: HI HELLO GOOD MORNING Third item 23

Tables 24 ElementDescription table thead table head tbody table body tfoot table footer tr table row th table head td table data (cell)

Sample Table Web Applications (NSWI142 ), Lecture 225 Name Address Joe White Lloyd Ave, Boston Bill Black ---

Grouping Table Cells  attribute colspan of element td  groups actual and following cells on the same row to a single cell  specifies the number of grouped cells  attribute rowspan of element td  groups actual and following cells on the same column to a single cell  specifies the number of grouped cells Web Applications (NSWI142 ), Lecture 226

Sample Grouped Table Cells Web Applications (NSWI142 ), Lecture 227 Adults 2 Adult Adult 2 32 Children 3 Child Child Child 3 12

Forms allows to get data from users form is component of Web page composed of form controls user can interact with form controls by providing data which can be sent to server for further server-side processing element form – attribute method value post – data in HTTP request body (non-visible for user) value get – data in HTTP request URI (visible for user) – attribute action – URI where data are sent by browser

Forms input, textarea and select elements – various types of controls for providing data by user button element – buttons

Sample Form me=aaa&password=bbb&age=19&product=B MW&product=AUD&product=MER me=aaa&password=bbb&age=19&product=B MW&product=AUD&product=MER 30 Name: Phone: Preferred delivery time: Comments: Submit order

Forms – element input basic form input field attribute name specifies name which identifies the field – for script which processes data on server attribute type specifies kind of field – text – input is one line of text + attribute maxlength – maximal text length – password – same as text but hidden input characters (do not use GET) – radio – exclusive choice (radio buttons) from set of fields with the same name + attribute value – value send to server when field is selected + attribute checked="checked" – default choice – checkbox – multiple choice, same logic as radio

Sample Form 32 Name: Password: Age: 0-18 : : 66-* : Product: BMW Audi Mercedes

Forms – element input attribute type specifies kind of field – submit – submission button + attribute value contains displayed button value – reset – reset button + attribute value contains displayed button value – hidden – submitted value hidden to user – file – file submission

Sample Form Name: Password: 34

Forms – element input field might be further specified maxlength attribute – maximum number of characters allowed in field size attribute – number of characters visible in field value attribute – specifies default field value disabled attribute – specifies that field is disabled when form loads

Sample input <input name="full_name" maxlength="32" size="16" value="Martin Nečaský" disabled="true" title="First name followed by family name." /> Submit order

Forms – element select list of options user selects from element option – content – value shown to user – attribute value – submitted value – attribute selected="selected" – default value attribute multiple="multiple" – allows user to select more values attribute size – number of options displayed to user

Sample select Product: BMW Audi Mercedes Skoda Chevrolet Toyota Ford 38

Readable forms form may be made better readable fieldset element – Groups semantically related fields legend element – field-set label label element – field label title attribute – may serve as hint for input field – note: this is general attribute (may be used with any HTML element)

Readable forms Name: Contact information Phone: Timing Preferred delivery time: Comments: Submit order Submit order

Forms in HTML5 new types in HTML 5 – search (search field) – tel (phone field) – url (absolute URL field) – ( field) – date, time, datetime (date/time field) – number (number field) – range (number field) – color (color field)

Forms in HTML5 Search Phone URL Date Time Datetime Number Range Color Submit

Forms in HTML5 field might be further specified autocomplete attribute – values on/off – allows to disable field value autocomplete autofocus attribute – gives field focus when page loads pattern attribute – regular pattern for field value validation placeholder attribute – hint for user to help with filling the field required attribute – field value is required

Forms in HTML5 <input name="phone" autocomplete="off" autofocus="autofocus" pattern="[0-9]{9}" placeholder="Fill in your 9-digit phone number." required="required" /> Submit order

Forms in HTML5 … and even more (HTML 5) min attribute – minimal value of numerical field max attribute – maximal value of numerical field step attribute – step for numerical field etc.

Submitting Forms when form is submitted data is converted by encoding algorithm and send to selected destination using given method (get/post) enctype attribute of element form – specifies encoding algorithm – application/x-www-form-urlencoded – multipart/form-data – text/plain

Submitting Forms <form enctype="application/x-www-form-urlencoded" action=" method="get">...

Images element img image in document attribute src – image URL attributes width and height – image size in pixels – good practice attributes alt and title 48

Document Metadata data about document inside element head title – document title or name – should identify document for users even used out of context base – specifies document base URL for resolving relative URLs link – links document to other resources style – embeds style information inside document meta – other metadata

Document Structure Technologies for … <meta http-equiv="content-type" content="text/html; charset=utf-8" />

More on Links link represents relationship of particular type between current document and other web resource elements link and a two kinds of links (according to HTML 5.0 specification) – links to external resources links to resources which augment/further specify current document – hyperlinks links to resources which are exposed to user of current document to navigate to those resources kind depends on element used and relationship type

More on Links href attribute – URL of resource linked by relationship rel attribute – type of relationship media attribute – media linked resource applies to – e.g. print, screen, all type attribute – MIME type of linked resource – text/html, application/xhtml+xml, text/css, application/pdf

More on Links Link typelinkaDescription alternate HHAlternate representation of current document author HHAuthor of document icon ER-Icon representing current document stylesheet ER-Stylesheet for current document licence HHCopyright license covering current document first HHFirst document of a series current document is part of last HHLast document of a series current document is part of next HHNext document in a series current document is part of

More on Links NSWI117 – Materials <link rel="stylesheet" href="default.css" type="text/css" media="screen" /> <link rel="stylesheet" href="default-print.css" type="text/css" media="print" /> <link rel="alternate" href="materials.pdf" type="application/pdf" media="print" /> Author: <a href=" rel="author"> Martin Nečaský

HTML Markup – 4.01 vs. 5 no sense to go through particular differences in this lecture see Web Applications (NSWI142 ), Lecture 255