Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

Similar documents
Web Design 101. What is HTML? HTML Tags. Web Browsers. <!DOCTYPE html> <html> <body> <h1>my First Heading</h1> <p>my first paragraph.

HTML Images - The <img> Tag and the Src Attribute

Programmazione Web a.a. 2017/2018 HTML5

COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

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

Web Technologies - by G. Sreenivasulu Handout - 1 UNIT - I

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

INTRODUCTION TO WEB USING HTML What is HTML?

Spring 2014 Interim. HTML forms

Web Publishing with HTML

Creating Web Pages Using HTML

HTML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Department of Computer Engineering Khon Kaen University

Web Designing HTML5 NOTES

CSC 121 Computers and Scientific Thinking

A Brief Introduction to HTML

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

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

Introduction to HTML

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

11. HTML5 and Future Web Application

UNIT-02 Hyper Text Markup Language (HTML) UNIT-02/LECTURE-01 Introduction to Hyper Text Markup Language (HTML) About HTML: [RGPV/Dec 2013(4)]

A Balanced Introduction to Computer Science, 3/E

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

CSC Web Technologies, Spring HTML Review

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

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

Building Web Based Application using HTML

Introduction to using HTML to design webpages

Web Engineering (Lecture 01)

Introduction to Computer Science (I1100) Internet. Chapter 7

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

This document provides a concise, introductory lesson in HTML formatting.

I-5 Internet Applications

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

introduction to XHTML

Part 1: HTML Language HyperText Make-up Language

With HTML you can create your own Web site. This tutorial teaches you everything about HTML.

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

Introduction to Computer Science (I1100) Internet. Chapter 7

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

Desire2Learn: HTML Basics

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

Hyper Text Markup Language HTML: A Tutorial

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

(Refer Slide Time: 01:41) (Refer Slide Time: 01:42)

By Ryan Stevenson. Guidebook #2 HTML

MMGD0204 Web Application Technologies. Chapter 3 HTML - TEXT FORMATTING

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

A website is a way to present your content to the world, using HTML to present that content and make it look good

CSE 3. Marking Up with HTML. Comics Updates Shortcut(s)/Tip(s) of the Day Google Earth/Google Maps ssh Anti-Spyware

HTML Element A pair of tags and the content these include are known as an element

HTML OBJECTIVES WHAT IS HTML? BY FAITH BRENNER AN INTRODUCTION

CSC Web Programming. Introduction to HTML

7300 Warden Avenue, Suite 503 Markham, Ontario Canada L3R 9Z6. Phone: Toll Free: Fax:

5/17/2009. Marking Up with HTML. An HTML Web Page File. Tags for Bold, Italic, and underline. Structuring Documents

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

CMPT 165 Unit 2 Markup Part 2

Chapter 1 Self Test. LATIHAN BAB 1. tjetjeprb{at}gmail{dot}com. webdesign/favorites.html :// / / / that houses that information. structure?

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

Management Information Systems

Html basics Course Outline

Web Publishing Basics I

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

1.264 Lecture 12. HTML Introduction to FrontPage

Comp-206 : Introduction to Software Systems Lecture 23. Alexandre Denault Computer Science McGill University Fall 2006

How the Internet Works

Comp-206 : Introduction to Software Systems Lecture 22. Alexandre Denault Computer Science McGill University Fall 2006

Selected Sections of Applied Informatics

Chapter 4: Marking Up With HTML: A Hypertext tmarkup Language Primer

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

Creating Web Pages. Getting Started

Marking Up with HTML. Tags for Bold, Italic, and underline. An HTML Web Page File. Chapter 4: Marking Up With HTML: A. Formatting with Tags:

1. The basic building block of an HTML document is called a(n) a. tag. b. element. c. attribute. d. container. Answer: b Page 5

Web Programming Week 2 Semester Byron Fisher 2018

The Hypertext Markup Language (HTML) Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

c122jan2714.notebook January 27, 2014

Fall Semester 2016 (2016-1)

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

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

Introduction to HTML. SSE 3200 Web-based Services. Michigan Technological University Nilufer Onder

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

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

HTML 5.0 KKCC INFO SYSTEMS. K.SrinivasaRao

AMAN Computer Institute. HTML Lesson

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

Hyper Text Markup Language

Basics of Web Design, 3 rd Edition Instructor Materials Chapter 2 Test Bank

request HTML Document send HTML Document

Advanced HTML Scripting WebGUI Users Conference

CHAPTER 1: GETTING STARTED WITH HTML CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

What You Will Learn Today

HTML and CSS: An Introduction

Announcements. Paper due this Wednesday

Networking and Internet

Introduction, Notepad++, File Structure, 9 Tags, Hyperlinks 1

HTML Forms. By Jaroslav Mohapl

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

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 1

Chapter 4 A Hypertext Markup Language Primer

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

Transcription:

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 5049 Advanced Internet Technology Lab Lab # 1 Eng. Haneen El-masry February, 2015

Objective To be familiar with HTML Language. Introduction To make a web page we need to write a code that describes and controls in this web page, also we need a web server to run the code and send a response that contains HTML code for a required page from a web browser. Connection between web browser and web server The web server identifies each web page by URL (Uniform Resource Locator), the user enters the URL of the required web page via a web browser. Using HTTP (Hyper Text Transfer Protocol), TCP connection is established through port 80 by default, then the web browser sends an HTTP request that contains the URL and other information to the web server, the server handles with the HTTP request, then send an HTTP response that contains HTML code of the page and other information to the browser. What is HTML? HTML stands for Hyper Text Markup Language. HTML is a language for describing web pages. HTML is not a programming language, it is a markup language. HTML document describes a web page, the basic structure of an HTML document includes tags, which surround content and apply meaning to it. HTML Tags HTML tag is an instruction to the web browser, it instructs the browser how to render the web page. Tags are enclosed inside angle brackets <>. The first word in a tag, called the tag name, describes tag functions. Most tags have a start tag (opening tag) and a corresponding end tag (closing tag). An end tag is always the start tag s name preceded by a slash (/). 2

Elements Tags mark the beginning and end of an element. The elements are the components that make up web pages. The element content is everything between the start and the end tag. The format of the element that with content is: opening tag content closing tag. Some HTML elements have empty content, empty elements are closed in the start tag. Attributes HTML elements can also have attributes, which are extra information about the element. Attributes appear inside the opening tag in name/value pairs like: name="value". Attribute values should always be enclosed in quotes. Double style quotes are the most common, but single style quotes are also allowed. Note: In some rare situations, when the attribute value itself contains quotes, it is necessary to use single quotes i.e., name='haneen "Ibrahim" El-Masry'. Attribute names and attribute values are case insensitive. HTML Document Structure An HTML document begins with the <html> tag, which declares that the document is written in HTML. Each document has two parts, a head and a body, defines by <head> and <body> tags, respectively. The head part is optional, it contains the document title, using the <title> tag and other information the browser can use when rendering the document, and the body part contains the actual contents of the document. <html> <head> Head element <title> Welcome to JSP Lab </title> </head> <body> HTML element Body element. </body> </html> 3

Editing HTML HTML can be written and edited using many different editors like Dreamweaver, Front page and Visual Studio. However, we use a plain text editor (like Notepad) to edit HTML. When you save an HTML file, you can use either the.htm or the.html file extension. There is no difference, it is entirely up to you. Don't Forget the End Tag Some HTML elements might display correctly even if you forget the end tag, i.e., paragraph element. The example above works in most browsers, because the closing tag is considered optional. Never rely on this. Many HTML elements will produce unexpected results and/or errors if you forget the end tag. HTML ELEMENTS Page Title <p>this is a paragraph <title> tag is used to describe the title of the page. <title> tag is written in head element. To add a title to your page, change your code so that it looks like this: <html> <head> <title> JSP Lab </title> </head> <body> </body> </html> Paragraphs HTML paragraphs are defined with the <p> tag. <p>this is a paragraph </p> 4

Note: Browsers automatically add an empty line before and after a paragraph. Line breaks The web browsers don't usually take any notice of what line your code is on. It also doesn't take any notice of spaces, i.e., <p> this is line1 </p> this is line2 & <p> this is line1 this is line2 </p> Give you the same result This is line1 this is line2 The line-break tag can be used to separate lines like this: The result is : Note that because there's no content involved with the line-break tag, there is no closing tag and it closes itself with "/" after the "br". HTML Headings <p> This is line1 <br/> This is line2 </p> This is line1 This is line2 Headings are defined with the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines the least important heading. <h1>this is a heading</h1> <h2>this is a heading</h2> <h3>this is a heading</h3> 5

Note: Browsers automatically add some empty space (a margin) and empty line before and after each heading. Headings Are Important Use HTML headings for headings only. Don't use headings to make text BIG or bold. Search engines use your headings to index the structure and content of your web pages. Since users may skim your pages by its headings, it is important to use headings to show the document structure. H1 headings should be used as main headings, followed by H2 headings, then the less important H3 headings, and so on. HTML Links A hyperlink (or link) is a word, group of words, or an image that you can click on to jump to a new page or a new section within the current page. Links are specified in HTML using the anchor <a> tag. The destination of the link is defined in the href attribute of the tag. The link can be absolute to a new page, such as "http://www.google.com", or it can be relative to the current page. If the destination is absolute then the value of the href attribute is the URL of the web page, i.e., if we want to jump to a Google page, when we click on Google text, the code will be as following: <a href= http://www.google.com > Google </a> Else if the destination is relative to some section in current web page, you can add an id attribute to the section tag, and then link to it, as shown in the following example: <h2 id="top">welcome to JSP Lab</h2> <a href="#top">go to Top</a> Selecting Go to Top link will scroll the page straight to the element with that id. When you move the cursor over a link in a Web page, the arrow will turn into a little hand. The link does not have to link to another HTML file, it can link to any file anywhere on the web. 6

HTML Images HTML images are defined with the <img> tag, i.e., <img src="http://www.htmldog.com/images/logo.gif" width="157" height="70" alt="html Dog logo" /> <img src="1.png" width="104" height="142" /> The src attribute tells the browser where to find the image, the width and height attributes specify the size of the image in pixels by default, finally the alt attribute is the alternative description, it is used for people who cannot or choose not to view images. Like <br>, the <img> tag is empty, which means that it contains attributes only, and has no closing tag. The browser displays the image where the <img> tag occurs in the document. If you put an image tag between two paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph. HTML Lines The <hr /> tag creates a horizontal line in an HTML page. The hr element can be used to separate content, i.e., <p>this is a paragraph1</p> <hr /> <p>this is a paragraph2</p> HTML Comments Comments can be inserted into the HTML code to make it more readable and understandable. They are ignored by the browser and are not displayed. Comments are written like this: <!-- This is a comment --> Note: There is an exclamation point after the opening bracket, but not before the closing bracket. 7

HTML Tables Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). td stands for "table data," and holds the content of a data cell. A <td> tag can contain text, links, images, lists, forms, other tables, etc. <table> <tr> </tr> <tr> </tr> </table> <td>row 1, cell 1</td> <td>row 1, cell 2</td> <td>row 2, cell 1</td> <td>row 2, cell 2</td> The result will be as following: HTML Tables and the Border Attribute To display a table with borders, specify the border attribute. If you do not specify a border attribute, the table will be displayed without borders, i.e., HTML Table Headers <table border="1">... </table> Table Header is a header of each column of the table. Header information in a table are defined with the <th> tag. All major browsers will display the text in the <th> element as bold and centered. 8

<table border="1"> <tr> <th>header 1</th> <th>header 2</th> </tr> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> </table> The result will be as following: HTML Lists There are three types of list; unordered lists, ordered lists and definition lists. HTML Unordered Lists An unordered list items are marked with bullets (typically small black circles). The <ul> tag is used to identify the list element, and the <li> tag is used to identify the list item. <ul> <li>tea</li> <li>juice</li> </ul> How the HTML code above looks in a browser: HTML Ordered Lists An orderd list items are marked with incremental numbers. The ordered list starts with the <ol> tag. Each list item starts with the <li> tag. 9

<ol> <li>tea</li> <li>juice</li> </ol> How the HTML code above looks in a browser: HTML Definition Lists A definition list is a list of items, with a description of each item. The <dl> tag defines a definition list, the <dt> defines the item in the list and <dd> define the description of the item. <dl> <dt>tea</dt> <dd>- hot drink</dd> <dt>juice</dt> <dd>- cold drink</dd> </dl> How the HTML code above looks in a browser: Note: Inside a list item you can put text, line breaks, images, links, other lists, etc. 10

HTML Forms HTML form is a mechanism to allow users to provide input to a web site and pass the input to a server in the form of variables represented by name- value pairs. The following figure shows an example of HTML Form. A form can contain labels and input elements like text fields, checkboxes, radio-buttons, submit buttons, select lists, textarea and more. The <form> tag is used to create an HTML form. <form action= http://www.example.com method= get >. Labels input elements.. </form> The HTML form has two attributes: - action: it is required attribute which tells the form where its contents will be sent to when it is submitted. - method: it is optional attribute tells the form how the data in it is going to be sent and it can have the value get (which is default) or post. Get method: latches the information onto the URL. Post method: this is commonly used, it hides the information into HTTP request body. HTML Forms - The Input Element The most important form element is the input element. The input element is used to select user information., it can be of type text field, checkbox, password, radio button, submit button, and more. 11

<input> tag is used to describe the input element and the type attribute used to distinguish between input elements types. The most used input types are described below: Text Field The following HTML code used for text field: <input type= text name= ID value= 1 /> - Type attribute: sets the type of the input element. - Name attribute: sets the name of the variable which take the value of the text field. - Value attribute: sets the initial text in the textbox. <form action="html_form_action.asp" method="get"> Name: <input type="text" name="name" /> <br/> ID: <input type="text" name="id"/> </form> Password Field The following HTML code used for password field: <input type="password name= pwd /> Note: The characters in a password field are masked (shown as asterisks or circles). <form> Password: <input type="password" name="pwd" /> </form> 12

Radio Buttons <input type="radio" /> defines a radio button. Radio buttons let a user select ONLY ONE of a limited number of choices. <form> <input type="radio" name="sex" value="male" /> Male<br /> <input type="radio" name="sex" value="female" /> Female </form> Radio button can also have a checked attribute, which would be used in the format, and makes the initial state of the radio button to be switched on. Checkboxes <input type="radio" checked="checked" /> <input type="checkbox" /> defines a checkbox. Checkboxes let a user select ONE or MORE options of a limited number of choices. <form> <input type="checkbox" name="vehicle" value="juice" /> I want a juice <br /> <input type="checkbox" name="vehicle" value="ice cream" /> I want Ice cream </form> This can also have a checked attribute, which would be used in the format: <input type="checkbox" checked="checked" /> and makes the initial state of the check box to be switched on. 13

Submit button It is a button that when selected will submit the form. <input type="submit" /> is used to describe submit button. You can control the text that appears on the submit button with the value attribute, for example <input type="submit" value="submit />. <form action="html_form_action.asp" method="get"> Username: <input type="text" name="user" /> <br/> <input type="submit" value="submit" /> </form> HTML Textarea A textarea is a large textbox. <textarea> tag is used to describe the textarea element. It requires a rows and cols attribute and is used like this: <textarea name= textarea1 rows="5" cols="20 > A big load of text here </textarea> HTML drop-down select boxes The HTML drop-down select box consists of options. The user can select ONLY ONE of this options. <select> tag is used to describe the select boxes, and the <option> tag is used to describe each option. 14

They work like this: <select name= SelectedOption > <option value="first option"> Option 1 </option> <option value="second option"> Option 2 </option> <option value="third option"> Option 3 </option> </select> Similar to the checked attribute of checkboxes and radio buttons, an option tag can also have a selected attribute, which would be used in the format <option value="mouse" selected="selected">rodent</option>. The HTML Meta Element Metadata is information about data. The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page. Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata. The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services. Some search engines will use the name and content attributes of the meta element to index your pages. The <meta> tag always goes inside the head element. Metadata is always passed as name/value pairs. The following meta element defines a description of a page: <meta name="description" content="the first JSP Lab Material /> The intention of the name and content attributes is to describe the content of a page. 15