html hypertext markup language constantly evolving - extra facilities being added regularly java...

39
HTML • HyperText Markup Language • Constantly evolving - extra facilities being added regularly • Java applets and JavaScript used to increase functionality of HTML • A number of editors are available e.g. Microsoft Frontpage • Different Web Browsers display information slightly differently

Upload: osborne-sanders

Post on 27-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

HTML• HyperText Markup Language

• Constantly evolving - extra facilities being added regularly

• Java applets and JavaScript used to increase functionality of HTML

• A number of editors are available e.g. Microsoft Frontpage

• Different Web Browsers display information slightly differently

Page 2: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

HTML• A mark-up system that comprises of tags

• A tag is an instruction contained within angle brackets, e.g. <HTML>

• A tag may be opened and closed e.g.– <TITLE> Information Technology </TITLE>

• Images

• Forms

• Frames

• Firms often employ graphic designers

Page 3: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Structure of Document

• HTML documents can be constructed using Notepad

• When saved they should have extension .htm or .html

• <HTML>– defines the start of the HTML document – always on the first line– end of the document is defined by the </HTML> tag

Page 4: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Tags• <Head>

– document title

– Keywords for search engines

– located at the beginning of the document

– terminated with a </Head> tag

<HTML><HEAD><TITLE> My home page</TITLE></HEAD></HTML>

Page 5: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

More Tags

• <! -- your comments -- >

• <BR> Line Break

• <HR> Horizontal line

• <P> </P> Paragraph

Page 6: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

• <BODY> and </BODY> enclose the code which produces the visible web page

• Background colour may be defines• Colour of Text• Background Image

<HTML><HEAD><TITLE> My home page</TITLE></HEAD><BODY BACKGROUND = “at_work_transparent_low.gif”>This document is under construction</BODY></HTML>

Page 7: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Viewing Documents• Type in HTML using Notepad

• View using Netscape

• This way the page can be constructed incrementally

• Changes can be easily made– graphics in wrong place– text too large– Background wrong colour

• Possible to view other pages source

Page 8: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Title

• Appears as title in window• appears in bookmark list• Web search engine

<HTML> <HEAD> <TITLE> Here is my title</TITLE> </HEAD><HTML>

Page 9: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Plain Text• No tag is required when plain text is included

<HTML> <HEAD> <TITLE> Here is my title</TITLE> </HEAD> <BODY> This is plain text information </BODY><HTML>

• Text Usually requires formatting

Page 10: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Paragraphs• We want to display 2 lines of text:

<BODY> Barry McCollum Lecturer </BODY>

• The Browser does not recognise this unless a tag is added

• <P> Paragraph– Inserts a blank line

• <BR> New Line

Page 11: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

• Browser will also ignore multiple spaces:<BODY> Barry McCollum <BR> Lecturer </BODY>

• The output will look like• Barry McCollum• A special entity for spacing characters is

provided:– &nbsp;

Barry &nbsp; &nbsp; &nbsp; McCollum

Page 12: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Highlighting Text

• Bold– <B> Highlighted Text</B>– <STRONG> Highlighted Text </STRONG>

Highlighted Text

• Italic– <I>Highlighted Text</I>– <EM> Highlighted Text </EM>

Highlighted Text

Page 13: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

• Underline– <U> Highlighted Text </U>

Highlighted Text

• Blinking– <Blink> </Blink>

• Subscript– <SUB> </SUB>

• Superscript– <SUP> </SUP>

Highlighting Text

Page 14: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Headings• There are six levels of Headings, numbered 1 through 6 (1

being the largest)• Each level is displayed using a different heading level

number:

– <HI> Introduction </H1> Introduction– <H2> Introduction </H2> Introduction– <H3> Introduction </H3> Introduction– <H4> Introduction </H4> Introduction– <H5> Introduction </H5> Introduction

– <H6> Introduction </H6> Introduction

Page 15: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Alignment• Default Alignment is to the left• Text may be centred

– <centre> text to be centred</centre>

• Some tags can include attributes• Used to provide additional information to the

tag<HI align=right>

Introduction

</H1>

Introduction

Page 16: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Comments

• Good Practice

• Author’s name, date etc..– <!--> comment <-->

Page 17: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Text• <Font> </Font>

– Size• range of 1 to 7

• increased by using +

• decreased by using -

– Color• Colour Codes

– Face• Victorian

• Courier

Page 18: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Lists

• Unnumbered with bullet

• numbered

• Definition List

• Several Tags are required

• First tag determines type of list

• Each line in the list begins with the <LI> tag

Page 19: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Unnumbered List

• <UL> </UL>

• Type of bullet point can be changed by the TYPE attribute:

<UL Type=square>

<LI> first

<LI> second

</UL>

Page 20: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Numbered List• <OL> </OL>

• Attributes– STYLE– START

Definition List• Definition term and subsequent description

– <DL> start– <DT> each term is defined – <DD> each term is described

Page 21: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

<dl>

<dt> Floppy Disk

<dd> A Floppy Disk contains 1.4 Mbytes of info.

<dt> Compact Disk

<dd> A CD contains 640 Mbytes of information.

<dt> DVD

<dd> A DVD contains much more!

</dl>

Page 22: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

The output looks like:

Floppy Disk

A Floppy Disk contains 1.4 Mbytes of info.

Compact Disk

A CD contains 640 Mbytes of information.

DVD

A DVD contains much more!

Page 23: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Nested List• A lists can be nested:

<ul> <li> A few New England states: <ul> <li> Vermont <li> New Hampshire <li> Maine </ul> <li> Two Midwestern states: <ul> <li> Michigan <li> Indiana </ul></ul>

Page 24: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

The output looks like

A few New England states:

Vermont

New Hampshire

Maine

Two Midwestern states:

Michigan

Indiana

Page 25: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Hyper Links• Connect One Web page to another Web page• The <a> </a> tag is used to provide a link within a

Web Page. The “a” stands for anchor

• The general use of the <a> </a> tag is as follows:

<a href=”page to link to”>Click here!</a>

• This will display the following:

Click here!

Page 26: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

href

• The attribute href is used to point to a Web Page. This is represented by “page to link to” and is the target page which the link is pointing to.

• There a number of forms which “page to link to” can take, depending on the type of link required.

Page 27: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Relative Links

• Usually the Web Site has an initial starting page (Home Page) which connects to the other pages in the Site e.g.

• The home page is created and the HTML document is called “index.html”.

• The secondary page is created and the HTML document is called “info.html”.

Page 28: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

• Creating the link from the home page to the secondary page involves adding an <a> </a> tag to the body section of “index.html”.

<html>

<head>

<TITLE>Home Page</TITLE>

</head>

<body>

<a href=”info.html”>Click for Information</a>

</body>

</html>

Page 29: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Absolute Links• Uniform Resource Locators (URLs) are used instead of

relative links for linking to Web Pages on other Web Sites.

• The only difference between using absolute and relative links is that the target URL replaces the HTML document.

For example,

<a href=”http://www.qub.ac.uk”>Link to QUB</a>

Page 30: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

• An absolute link can also be used to allow electronic mail to be sent via a Web Page.

• The http is replaced with the word mailto followed by the email address.

• For example,

<a href="mailto:[email protected]">Mail Us</a>

• When clicked this link will open a blank mail window automatically addressed to the email address specified in the link.

Note that the two forward slashes // are missing in this case.

Page 31: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Links to Specific Sections

• Anchors can also be used to move a reader to a particular section in a document (either the same or a different document)

• This type of an anchor is commonly called a named anchor

• This involves two procedures– Mark the section which the link will move to.– Add the link, specifying the section of the document to link

to, using the mark.

Page 32: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

• Marking the appropriate section involves adding an <a> </a> tag to the HTML document with the name attribute. E.g.

<a name="endmarker">Bottom of the Page!</a>

• This attribute is used to specify an identifier, which can be any sequence of letters.

• The tag is placed at the location to which the browser must scroll when the link is followed. In this case, the tag is placed somewhere at the bottom of the Web Page.

Page 33: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

• The link is then added to the top of the page, specifying the identifier:

•<a href=”#endmarker”>Click to scroll down</a>

• The identifier is used by the href attribute and is used instead of specifying an HTML document filename or absolute link. The hash # must be inserted before the identifier.

Page 34: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

• An anchor can also be used to link to a specific section in another document.

• For example, a link can be made from “index.html” to a specified section within “info.html”.

• First, as before, the location to link to must be specified in “info.html”:

<a name="infomarker">Middle of Info Page!</a>

• Then the link is added to “index.html”. It takes the form:– <a href=”info.html#infomarker”>Click for some Info</a>

Page 35: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Images

• <IMG>– SRC– Align

• Top, middle, bottom

– HSPACE– VSPACE

• Image Maps

Page 36: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Visual Basic/Java

• Brings animation and Interaction to the WWW

• Can add animation sounds to the web page

• Visual Basic for Applications (VBA)

• VBScript – smaller faster subset– Embedded in HTML

Page 37: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Java

• Applet– a program embedded in HTML

• Application– similar, does not require a browser to run it

• Beans– each program performs a very limited function

• Run on any computer which has a Java compatible Web Browser

Page 38: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality

Javascript

• Developed by Netscape

• included directly in HTML document

• Simple to add extra functionality

Page 39: HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality