HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

Similar documents
HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Html basics Course Outline

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

HTML Tags <A></A> <A HREF=" CNN </A> HREF

Web Technology. HTML & xhtml

Website Development with HTML5, CSS and Bootstrap

Web and Apps 1) HTML - CSS

CSC Web Technologies, Spring HTML Review

Programmazione Web a.a. 2017/2018 HTML5

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

HTML 5 Tables and Forms

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

Tutorial 5 Working with Tables and Columns. HTML and CSS 6 TH EDITION

IMY 110 Theme 7 HTML Tables

CS144 Notes: Web Standards

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Final Exam Study Guide

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Advanced HTML Scripting WebGUI Users Conference

HTML What is HTML Hyper Text Markup Language is a computer based language used to create WebPages.

Name Related Elements Type Default Depr. DTD Comment

Index. CSS directive, # (octothorpe), intrapage links, 26

Indian Institute of Technology Kharagpur. HTML Part III. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T.

Introduction to WEB PROGRAMMING

HYPERTEXT MARKUP LANGUAGE ( HTML )

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Intro to html. --- define every element, attribute, and entity along with the rules for their use

Creating Web Pages Using HTML

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

LING 408/508: Computational Techniques for Linguists. Lecture 14

HTMLnotesS15.notebook. January 25, 2015

Chapter 4 Notes. Creating Tables in a Website

HTML WORKSHEET Explain HTML HEAD Tag Title Tag BASEFONT Tag

introduction to XHTML

Web Design and Application Development

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Summary 4/5. (contains info about the html)

HTML BEGINNING TAGS. HTML Structure <html> <head> <title> </title> </head> <body> Web page content </body> </html>

CSS Cascading Style Sheets

Certified HTML5 Developer VS-1029

HTML. LBSC 690: Jordan Boyd-Graber. October 1, LBSC 690: Jordan Boyd-Graber () HTML October 1, / 29

Creating Tables in a Web Site Using an External Style Sheet

HTML: Fragments, Frames, and Forms. Overview

CSC Web Programming. Introduction to HTML

HTML. HTML Evolution

HTML & CSS. Lesson 1: HTML Basics Lesson 2: Adding Tables Lesson 3: Intro to CSS Lesson 4: CSS in more detail Lesson 5: Review

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

HTML & XHTML Tag Quick Reference

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Structuring Documents for the Web 1

Web Development and HTML. Shan-Hung Wu CS, NTHU

Introduction to Computer Science (I1100) Internet. Chapter 7

COMP1000 Mid-Session Test 2017s1

Midterm Review. October 17

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Chapter 4 Creating Tables in a Web Site Using an External Style Sheet

INFS 2150 / 7150 Intro to Web Development / HTML Programming

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

WTAD Text Editors for HTML. Text Editors: Kate HTML. (HyperText Markup Language)

WTAD. Unit -1 Introduction to HTML (HyperText Markup Language)

Deccansoft Software Services

1. Lists. 1.1 Unordered Lists. Subject Code 10CS73. Unit 2 XHTML 2, CSS. Subject Programming the Web

HTML and CSS: An Introduction

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 2 Introduction to XHTML

CSC 121 Computers and Scientific Thinking

ITNP43: HTML Lecture 3

Go.Web Style Guide. Oct. 16, Hackensack Ave Hackensack, NJ GoAmerica, Inc. All rights reserved.

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

Building Web Based Application using HTML

Table-Based Web Pages

Title: Jan 29 11:03 AM (1 of 23) Note that I have now added color and some alignment to the middle and to the right on this example.

Creating Web Pages. Getting Started

HyperText Markup Language/Tables

By completing this practical, the students will learn how to accomplish the following tasks:

CPSC 481: CREATIVE INQUIRY TO WSBF

Modify cmp.htm, contactme.htm and create scheduleme.htm

HTML & CSS November 19, 2014

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

Creating HTML files using Notepad

HTML. Hypertext Markup Language. Code used to create web pages

2.1 Origins and Evolution of HTML. 2.3 HTML Document Structure

2.1 Origins and Evolution of HTML

Creating a Web Page with HTML

CSS: The Basics CISC 282 September 20, 2014

Chapter 7 Tables and Layout

A Balanced Introduction to Computer Science, 3/E

Chapter 7 Tables and Layout

Learning Objectives. Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

The [HTML] Element p. 61 The [HEAD] Element p. 62 The [TITLE] Element p. 63 The [BODY] Element p. 66 HTML Elements p. 66 Core Attributes p.

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

Markup Language. Made up of elements Elements create a document tree

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Lab Introduction to Cascading Style Sheets

Table Basics. The structure of an table

Transcription:

HTTP and HTML We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms. HTTP and HTML 28 January 2008 1

When the browser and the server communicates they use the HTTP protocol. HTTP Browser Server The browser sends a request to the server and gets back a response. Request Browser Response Server HTTP is a stateless protocol, i. e. it has no memory. Your request is received, a reponse is constructed and returned to you, and the server forgets all about it. There are two versions of HTTP, 1.0 and 1.1 HTTP and HTML 28 January 2008 2

The browser locates the server using a URL, a Universal Resource Locator. A URL is a special case of a URI, a Universal Resource Identifier. Examples of: URL s are: http://www.it.uu.se http://user.it.uu.se/~olle http://www.it.uu.se?action=show&name=nisse http://www.it.uu.se?action=show& name=nisse+andersson http://tomcat.it.uu.se:8080/olle/test HTTP and HTML 28 January 2008 3

A request can look like GET /index.html HTTP/1.1 Host: www.gefionsoftware.com User-Agent : Mozilla/4.5 [en] (WinNT; I) Accept: image/gif, image/jpeg, image/png, */* Accept-Language : en Accept-Charset : iso-8859-1,*,utf-8 A response can look like HTTP/1.1 200 OK Last-Modified: Mon, 20 Dec 2001 23:26:42 GMT Date: Tue, 11 Jan 2002 20:52:40 GMT Status: 200 Content-Type: text/html Servlet-Engine: Tomcat Web Server/4.0.1 Content-Length: 59 <html> <body> <h1>hello World</h1> </body> </html> HTTP and HTML 28 January 2008 4

There are several request methods in HTTP: GET POST HEAD OPTIONS PUT TRACE DELETE CONNECT The HEAD is used if you just want the header of the response. GET and POST are used to send a request to the server. GET can only use the URL string to pass data to the server POST can transfer data within the body of the request. HTTP and HTML 28 January 2008 5

HTML, HyperText Markup Language is used by the browser to produce the output. HTML is text with embedded tags. Some basic tags are: <!doctype... > <html> </html> <head></head> <title></title> <body></body> <h1></h1> <h2></h2> <p> <br> <b></b> <i></i> <u></u> <!-- --> Most of the tags have an opening tag and a closing tag. HTML is not case sensitive. Some systems use XHTML, that is a stricter version of HTML: lower case tags only must have closing tags, e. g. <i> </i> or <br/> tags must be nested correctly HTTP and HTML 28 January 2008 6

Anchor tags, a link to another place: An absolute URL <a href= http://www.it.uu.se/lesit > LäsIT </a> Relative URL s, relative the current directory <a href=../ht03/index.html > autumn course</a> <a href= email/index.html > mail list</a> The anchor tag has an attribute,, it has a name, href, and a value. Attributes are separated by spaces. Quoted values are optional in HTML but required in XHTML and XML. HTTP and HTML 28 January 2008 7

Tables in HTML: The basic table tags are <table>, <tr>, <td>, starts a table starts a table row starts a cell within a row Some attributes: <table> border, cellspacing, cellpadding, width height <tr> valign width of the border number of pixels between cells number of pixels between the contents of a cell and the edge of the cell width of the table, pixels height of the table, pixels vertical alignment of the contents of the row, Top, Bottom or Middle HTTP and HTML 28 January 2008 8

<td> align colspan rowspan height width valign horizontal alignment of contents of the cell, Left, Right or Center number of columns that the cell will span the number of rows the cell will span height of the cell width of the cell override valign in <tr> <table cellspacing= 5 cellpadding= 5 border= 1 > <tr> <td align= right > First name:</td> <td> John</td> </tr> <tr> <td align= right > Last name:</td> <td> Smith</td> </tr> <tr> <td align= right > Email address:</td> <td> jsmith@hotmail.com</td> </tr> </table> HTTP and HTML 28 January 2008 9

The <img> tag, images: Some attributes: src height width alt border hspace vspace align URL for a GIF or JPEG image height of the image width of the image text that is to be displayed if you can t display an image border width horizontal space on the left and right side of the image vertical space on the top and bottom of the image alignment of the image on the page Left, Right, Top, Bottom, Middle <img src=../images/olle.gif alt=../text/olle.html width= 150 height= 65 align = Left > HTTP and HTML 28 January 2008 10

Style sheets: HTML can use CSS (Cascading Style Sheets) style sheets. This means that you create a style sheet file that applies to the selected elements e. g. Put this in the file murach.css p {font-family: Arial, sans-serif; font-size: 12px} a:hover {text-decoration : underline; color : #CC0000} h1 { font-family: Arial, sans-serif; font-size: 16px; color : #003366; vertical-align : top; margin-top: 10px; margin-bottom: 0px} h2 { font-family: Arial, sans-serif; font-size: 16px; color : #003366} h3 { font-family: Arial, sans-serif; font-size: 16px; color : #003366} HTTP and HTML 28 January 2008 11

Can be used by a <link> tag <head> <title> CSS example </title> <link rel= stylesheet href= murach.css > </head>... HTTP and HTML 28 January 2008 12

The <form> tag specifies a form that can be filled in and submitted to the server. A form is built from controls, a control is a text field, a menu, a button etc. A control is defined with the <input> tag. There should be a submit button in a form. The most common attributes to <form> is name, action, method, The name of the form The URL to use when the form is submitted The HTTP method to use, GET or POST <form action= entry.jsp method= post >... </form> HTTP and HTML 28 January 2008 13

GET uses the actions URL to append all data using the?name=value -syntax. POST sends all data as a separate part of the request block This means that: A GET request has a size limitation. It can be bookmarked with all data, this might not always be desirable A POST request does not show the parameters, therefore they cannot be bookmarked and there is no size limitation. The default is GET. One rule that can be used here is: Use GET if the request is a readonly request. Otherwise POST. HTTP and HTML 28 January 2008 14

Each control has three optional parameters: type, name and value: name, value, type, the name of the control the value of the control. The name and value produces a name/value pair that is submitted as data. The meaning of the value differs depending on the type of control type is one out of text, checkbox, radio, password, submit, reset, hidden, image, button and file. The default is text. HTTP and HTML 28 January 2008 15

An example of a form looks like <!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN > <html> <head> <title>a simple form</title> </head> <body> <p> Here s a form that contains two text boxes and a button: </p> <form action= entry.jsp method= post > <p> First name <input type= text name= firstname ><br> Last name <input type= text name= lastname ><br> <input type= submit value= Submit > </p> </form> </body> </html> HTTP and HTML 28 January 2008 16

It produces this: HTTP and HTML 28 January 2008 17

Another form <!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN > <html> <head> <title>another simple form</title> </head> <body> <form action= entry.jsp method= post > <p> Username: <input type= text name= username value = jsmith ><br> Password: <input type= password name= password value= opensesame ><br> <input type= hidden name= productcode value= jr01 > <input type= submit value= login > </p> </form> </body> </html> HTTP and HTML 28 January 2008 18

Produces this: HTTP and HTML 28 January 2008 19

One more example <!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN > <html> <head> <title>another simple form</title> </head> <body> <form action= entry.jsp method= post > <p> <input type= submit value = Submit ><br> <input type= reset value= Reset ><br> <input type= button value= Validate onclick= validate(this.form) > </p> </form> <form action= /shop method= post > <p> <input type= submit value = Continue Shopping ><br> </p> </form> <form action= /checkout method= post > <p> <input type= submit value = Checkout ><br> </p> </form> </body> </html> HTTP and HTML 28 January 2008 20

Gives us this with several forms HTTP and HTML 28 January 2008 21

Still another example <!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN > <html> <head> <title>another simple form</title> </head> <body> <form action= entry.jsp method= post > <p> <input type= checkbox name= addemail checked> Yes add me to your mailing list<br> Contact me by:<br> <input type= radio name= contacvia value= Email >Email <input type= radio name= contacvia value= Postal Mail >Postal mail <input type= radio name= contacvia value= Both >Both <br> I m interested in these types of music<br> <input type= checkbox name= rock > Rock<br> <input type= checkbox name= country > Country<br> <input type= checkbox name= bluegrass > Bluegrass<br> <input type= image value= submit SRC=./olle.gif ALT= Send It > </p></form> </body> </html> HTTP and HTML 28 January 2008 22

Which gives us this, with a big nice button HTTP and HTML 28 January 2008 23

One final example showing select and textarea <!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN > <html> <head> <title>another simple form</title> </head><body> <form action= entry.jsp method= post > <p> Select a country:<br> <select name= country > <option value= USA selected>united States <option value= Canada >Canada <option value= Mexico >Mexico </select> </p> <p> Select one or more countries:<br> <select name= countries multiple> <option value= USA selected>united States <option value= Canada >Canada <option value= Mexico >Mexico </select> <br> Comments:<br> <textarea name= comment rows= 5 cols= 60 > </textarea> </p> </form> </body> </html> HTTP and HTML 28 January 2008 24

Gives us this HTTP and HTML 28 January 2008 25

You can add the attribute tabindex= nn to a control to set the order that tabbing through the controls will follow. HTTP and HTML 28 January 2008 26