HYPERTEXT MARKUP LANGUAGE ( HTML )

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

Creating Web Pages. Getting Started

11. HTML5 and Future Web Application

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

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

CSC 121 Computers and Scientific Thinking

Html basics Course Outline

Web Publishing Basics I

INFS 2150 / 7150 Intro to Web Development / HTML Programming

A Balanced Introduction to Computer Science, 3/E

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

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

Bridges To Computing

HTTP & Websites. Web Browsers. Web Servers vs. Web sites. World Wide Web. Internet Explorer. Surfing the World Wide Web. Part 4. The World Wide Web

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

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

DREAMWEAVER QUICK START TABLE OF CONTENT

introduction to XHTML

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

c122jan2714.notebook January 27, 2014

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

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

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

Certified HTML5 Developer VS-1029

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

By Ryan Stevenson. Guidebook #2 HTML

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

Introduction to Computer Science (I1100) Internet. Chapter 7

HTML & XHTML Tag Quick Reference

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:

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

request HTML Document send HTML Document

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

CMPT 165 Unit 2 Markup Part 2

1.264 Lecture 12. HTML Introduction to FrontPage

INTRODUCTION TO WEB USING HTML What is HTML?

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

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

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

Introduction to Computer Science (I1100) Internet. Chapter 7

Chapter 4 A Hypertext Markup Language Primer

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Creating Web Pages Using HTML

Basic HTML Lecture 14

HTML TUTORIAL ONE. Understanding What XHTML is Not

Creating A Web Page. Computer Concepts I and II. Sue Norris

INTRODUCTION TO HTML5! HTML5 Page Structure!

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

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

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

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

Brief Intro to HTML. CITS3403 Agile Web Development. 2018, Semester 1

2.1 Origins and Evolution of HTML

Creating Web Pages with SeaMonkey Composer

Announcements. Paper due this Wednesday

MPT Web Design. Week 1: Introduction to HTML and Web Design

Programmazione Web a.a. 2017/2018 HTML5

Dreamweaver Basics. Planning your website Organize site structure Plan site design & navigation Gather your assets

Basic HTML. Lecture 14. Robb T. Koether. Hampden-Sydney College. Wed, Feb 20, 2013

Basic HTML. Lecture 14. Robb T. Koether. Hampden-Sydney College. Wed, Feb 20, 2013

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

The University of Hawaii at Manoa Library Webpage Content/Design/Style Guidelines General Site Design... 2

It is possible to create webpages without knowing anything about the HTML source behind the page.

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

Hyper Text Markup Language HTML: A Tutorial

Motivation (WWW) Markup Languages (defined). 7/15/2012. CISC1600-SummerII2012-Raphael-lec2 1. Agenda

CSC Web Programming. Introduction to HTML

Student, Perfect Midterm Exam March 24, 2006 Exam ID: 3193 CS-081/Vickery Page 1 of 5

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

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

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

Chapter 4. Introduction to XHTML: Part 1

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

Certified HTML Designer VS-1027

Introduction to HTML

HTMLnotesS15.notebook. January 25, 2015

ICT IGCSE Practical Revision Presentation Web Authoring

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

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

How the Internet Works

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

Chapter 4 A Hypertext Markup Language Primer

2.1 Origins and Evolution of HTML. 2.3 HTML Document Structure

Table-Based Web Pages

< building websites with dreamweaver mx >

HTML Hyper Text Markup Language

Do It Yourself Website Editing Training Guide

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.

A Brief Introduction to HTML

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

GETTING STARTED. In Lesson 2 you will be shown your text editor for the course. This is my first web page

ATSC Week 2 Web Authoring

Selected Sections of Applied Informatics

Web Programming Week 2 Semester Byron Fisher 2018

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

What You Will Learn Today

More HTML. Images and links. Tables and lists. <h1>running in the family</h1> <h2>tonight 9pm BBC One</h2>

Bixby Public Schools Course Essential Elements Grade: Desktop Publishing

Management Information Systems

Beginning Web Site Design

Transcription:

1 HTML BASICS

MARK-UP LANGUAGES Traditionally used to provide typesetting information to printers where text should be indented, margin sizes, bold text, special font sizes and styles, etc. Word processors like MS Word, and typesetting systems like LaTex are also forms of mark-up languages. Rich Text Format (rtf) files are written in a mark-up text format. 2

HYPERTEXT MARKUP LANGUAGE ( HTML ) describes the structure of the document provides text and other formatting instructions to tell the browser how to render the material. has evolved to version 4.01. www.w3.org 3

WEB BROWSER Software when connected to the Internet is able to access documents at remote locations and display them locally in accordance with its interpretation of markup instructions in the document. Examples: Internet Explorer, Chrome, FireFox, Opera, etc. 4

HTML DOCUMENTS Plain text files, with extension htm or html. The extension tells the browser interpret the file according to HTML standards. Browsers may display other types of files as well, according to the file s extension. TXT -.txt - plain text file, no formatting. PDF -. portable document format (Adobe corporation) JPG -.jpg - JPEG image file. 5

HTML DOCUMENTS No special software is needed; you may use any plain text editor to create html files manually. Just start by copy-pasting the template codes provided into a new document in the editor program of your choice* and edit/revise the content with your own desired elements. Although HTML ignores white spaces, for convenient code viewing and editing, always be sure to use line breaks and indentations logically and sensibly. 6

WHICH TEXT EDITOR? Windows Users: Notepad is all you need but html files must always be saved as "All files" format. Notepad++ is one example of a nice alternative with handy features. Mac Users: TextEdit is all you need but since it is by default a RTF editor, it must be configured to the plain text mode in Preferences. Textwrangler is one example of a nice alternative for novice users who is not so comfortable with file format. 7

A WORD OF CAUTION: No matter which editor you use, if it is not strictly plain text, some characters may cause display errors. One common problem involves illegal quotation mark characters (double and single) such as those generated as smart quotes or inverted quotation marks ( ) that are improperly rendered by browsers. Such characters should be replaced by plain straight quote (" ") characters. 8

MORE ON HTML EXTENSIONS For special applications there are proprietary extensions for the html language although they are NOT official parts of html. Active Server Pages (ASP) files are server-side script engine by Microsoft. Personal Home Page: Hypertext Preprocessor (PHP) which, like asp, generally require the server to have a special handling package installed, for the extension. 9

CASE RESTRICTIONS Technically, HTML is not case-sensitive (caseinsensitive), meaning that either upper or lower case may be used in tags and the browser will not care. Example: <hr> = <HR> = <hr>. However, it is strongly recommended that you use lower case only in this course to avoid confusion. 10

DOCTYPE A pre-processor directive at the top of the document tells the browser (and the validator) what kind of standards apply to the document. Important: The pre-processor directive at the top, together with the <meta tag specifying the content type in the head are both required in your course assignment document to enable proper code validation. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <meta http-equiv="content-type" content="text/html;charset=utf-8"> *See their proper application in the "testpage.html" example in the next slide. 11

TEMPLATE *Use the codes below to begin constructing your assignment document. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>***replace this text with course & section number and your full name </title> </head> <body> <!--Begin your content specification by adding your elements here. --> </body> </html> 12

BASIC HTML DOCUMENT STRUCTURE Html document consists of the head and the body. The head contents are used by the browser/system. The body elements are rendered (displayed) by the browser. <html> { Markup Language Type Declaration } <head> <title> { Descriptive Text Here }</title> </head> <body> { Main content here } </body> </html> 13

THE HEAD (HEADER) SECTION <head> (begin the head section) <title> (a descriptive title of document) </title> <! --- >Optional items such as script here</> </head> (end of the head section) 14

THE BODY SECTION <body> { elements of the document to be displayed in the document area go here } </body> 15

BODY ELEMENTS html documents consist of a number of elements where text is placed in containers with a open/begin tag and an close/end tag (tandem tags) <open tag>some text goes here.</close tag> Some containers use only one tag aka empty or stand-alone tags <hr> : draws a line across the document <br> : a line feed, or break 16

BASIC CONSTRUCTS All tags must be nested correctly to pass validation. Rule of thumb: last-opened-first-closed Consider these element combination: <p> </p> contains a normal paragraph text and <em> </em> contains emphasized/bolder text Invalid: <p>this overlap is not <em> nested. </p> So it is invalid. </em> Valid: <p>this is correct <em>nesting.</em> It is valid.</p> 17

TEXT ELEMENT TAGS <p> </p> (Paragraph) <b> </b> (Bold) <i> </i> (Italics <u> </u> (Underline) <em> </em> (Emphasis - depends on browser) <br> (Line feed or break) <hr> (Horizontal Rule/line) 18

PRESET FORMAT <h1> </h1> (Heading level 1: most prominent) <h2> </h2> <h3> </h3> <h6> </h6> (Heading level 6: least prominent) <blockquote> (Indents content one tab) </blockquote> 19

LISTS: NUMBERED OR BULLETED {Begin an Ordered List numbered} <ol> <li> </li> {1st list element} <li> </li> {2nd list element} </ol> {End of Ordered List} {Begin anunordered List bulleted} <ul> </ul> 20

SIMPLE HTML DOCUMENT EXAMPLE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <! This is a comment line: you may place it anywhere in your document; the browser will ignore it.> <title> HTML document example</title> </head> <body> <h3> This be a heading level 3</h3> <p>this is a sentence in this document.</p> <p>this is another sentence.</p> <blockquote> <! The list below will be indented.> <ol> <li> First list item</li> <li> Second list item</li> <li> Third list item</li> </ol> </blockquote> </body> </html> 21

THE ANCHOR ELEMENT The anchor element, the tag name, single letter a, is used to connect or link different documents or parts of one document. Any text associated with the anchor element, called anchor text is displayed on the screen. When an anchor text is clicked, a 'jump' is made to the destination or target location. 22

HYPERTEXT LINKS Anchor tag is used to create a link that jumps from one point in a document to another destination (target location). Destination may be: a. external (another web site), or b. local (a document in the local server), or c. internal (another section in the current document). 23

GENERAL FORM: <a href = "URL"> anchor text </a> Be Sure To Read: Uniform Resource Locators (URLs) - what they are and how they're structured is explained in What is a URL? As our examples demeonstrate, there are many ways to specify the URL attributes in various situations. 24

EXAMPLE A (EXTERNAL): <a href = "http://www.yorku.ca">york University</a> Searches for the web address "www.yorku.ca" on the World Wide Web. The York site's default page, e.g., index.html, will be displayed when the site is located. 25

EXAMPLE B (LOCAL): <a href = "faves.html">my Favourite Things </a> Note: a particular file path is not specified here; the browser assumes the file is in the same directory as the calling document (default) and, if found, opens "faves.html" replacing the current page in the browser's document area. If the target file, faves.html, is not found, an error message will be displayed. 26

EXAMPLE C: (WARNING: NOT TRANSPORTABLE) <a href = "file://c:/myweb/resume.html">my Resume</a> The "file" protocol, tells the browser to search in the myweb subdirectory of the C: drive for the resume page - as long as the page is accessed from the same machine, this is not problematic. However in the context of the Web access, unless an identical file path exists in the web server (which is virtually never the case), the browser will fail to find the file. Therefore, a web page with such URL specification is not transportable, i.e., not useful for publication on the Web. 27

INTERNAL (NAMED) LINKS: Used to create a link that jumps from an origin point in a document to another location within the same document. The href attribute of the anchor tag at the origin point uses a hashtag (#) pre-pended to the destination name. <a href = "#target">go To Target</a> Another anchor placed at the destination (target) location in the document is marked with a name attribute. <a name = "target"> </a> Note the absence of the anchor text. 28

EXAMPLE D: INTERNAL (NAMED) LINKS <a href = "#references">go To Reference List</a> Displays "Go To Reference List" and causes a jump to the point of the named location when clicked. <a name = "references"> </a> Creates a named label "target" at the point in the document where it is located. Note: names are case-sensitive; must be identical in both tags. 29

IMAGES - EMBEDDED/INLINE The img (element) is used for displaying image and graphics files. Attributes: src = "filename. ": Identifies the file to be loaded into a document. align = "top", (or "middle", "bottom", "left", or "right") positions the image in the document 30

E.G. 1 <img src="../pix/selfie01.jpg"> Loads a jpeg* file named "selfie01" into the document at the location of the element. JPEG - Joint Photographic Experts Group compression format file extension,.jpg Note: the file must be found in the specified folder one level above current. 31

E.G. 2 <img src = "animals/elephant.gif" align = "right"> Loads a gif* file into the document at the location of the element, and moves it to the right hand side of the page. GIF - Graphics Interchange Format compression format - file extension,.gif Note: the file must be found in a subfolder of the current folder. 32

E.G. 3 <img src = "/graphics/redbaloon.bmp" align = "middle" height = "100" width = "200"> Loads a *.bmp file into the document, centers it vertically, relative to the line, and gives it a height of 100 pixels and a width of 200 pixels. BMP- BitMap: simpler non-compressed graphics image format. - file extension,.bmp Changing the height and width values may distort the original proportions of the image. Note: the file must be found in the subfolder of the rood directory. 33

E.G. 4 <img src = "winner.jpg" alt = "Sorry, no picture available!"> Displays the image if found in the default folder. If the image can not be loaded, the browser should display the text "Sorry, no picture available!" in its place. This facility was originally intended to accommodate text-only browsers but should always be included in your assignment document. 34

ANIMATED GIF FILE A *.gif image file which is composed of a series of frames or images, simulates motion by displaying the images in the file consecutively. It is an electronic equivalent of an older style celluloid motion picture. Only use with care. 35

TABLES A table is a matrix formed by the intersection of horizontal rows and vertical columns. Column 1 Column 2 Column 3 Row 1 Row 2 Row 3 36

TABLES The intersection of a column and row is called a cell. Cells in the same row or column are usually logically related in some way. Column 1 Column 2 Column 3 Row 1 cell cell cell Row 2 cell cell cell Row 3 cell cell cell 37

TABLES A table is defined by the tandem tag container <table> </table>. HTML expects everything between the start and end elements to be part of the table. Different browsers may render table element attributes differently, but, in general, things like cell spacing, type of border, size of cells, number of cells in a row, and background and text colors may be defined. 38

< tr > < /tr> Within each row container, each cell is defined by either table header < th > < /th >, or table data < td > < /td > <th> < /th > is for Table Header <td> < /td > is for ordinary Table Data The Table Header container < th > < /th > has exactly the same output as the combination: <td><center><b> </b></center></td> 39

Table Format [ 3 columns x 2 Rows ] <table> <tr> <th> Row Header </th> <td> Data </td> <td> Data </td> </tr> <tr> <td> Data </td> <td> Data </td> <td> Data </td> </tr> </table> 40

< th > and <td> Attributes: colspan = "x" : Forces the cell to cover "x" number of columns. Default = 1. E.G. < td colspan = "3" >... </td> rowspan = "y" : Forces the cell to cover "y" number of rows. Default = 1. font whatever = ( as desired ) : font attribute such as color, size, family, etc. valign = "top", "middle", or "bottom" : Sets vertical alignment in the cell. E.G. < td valign = "top" >... </td> align = "left", "center", or "right" : Sets horizontal alignment in the cell. 41

Other Table Options: <thead> </thead> Defines a header section. Contains <tr> elements. If used, it MUST precede a <tbody> </tbody> which contains the usual table rows, and this should be followed by a footer. <tfoot> </tfoot> These three are optional unless the first is used. 42

More Table Format [ 3 columns x 2 Rows ] <table> <thead> <tr> <th colspan = "3" align = "center"> Header </th> </tr> </thead> <tbody> <tr> <th> Row Header </th> <td> Data </td> <td> Data </td> </tr> <tr> <td> Data </td> <td> Data </td> <td> Data </td> <tr> </tbody> <tfoot> <tr> <th colspan = "3" align = "center"> Footer </th> </tr> </tfoot> </table> 43

More Example Specifications <table cellpadding = "3" cellspacing = "2" width = "85%" border = "0"> Define a table with: Three pixels between the inside edge of a cell and its contents, Two pixels between the outside edges of cells, A width of 85% of the browser display, No visible border. 44

Table cells may contain many different ordinary HTML containers, making them quite versatile as aids in layout and design. Including: Images Hypertext Links Lengthy Text Other tables Also, Applets & Objects 45

Table-in-a-table example: <table> <tr> <td> <table> <tr> <td> <img src = "somepicture.jpg"></td></tr> <tr> <td><a href = "targeturl">click ME!</td></tr> </table> </td></tr> </table> 46

Mailto: Linking to your E-mail client E.G. 1: Invokes a mail client to send an email to an email address <a href = "mailto:someone@somewhere.com" > User's system must be configured for email use. E.G. 2: send an email to the address with a subject <a href = "mailto: someone@somewhere.com?subject="hello there!" > *There is no space between "?" and "subject" 47

Validating HTML Codes HTML 4.01 is the last standard version. Note: HTML5, although now widely in use, is still considered "experimental"; hence not yet a true standard. In the context of the course assignment, as the preprocessor directive indicates, codes in the document must comply with the version 4.01 standard (4.0 is also acceptable). In addition, your assignment document must be validated accordingly via the W3C's Markup Validation Service. 48

Be sure to use the "Validate by File Upload" tab page. 49

If, instead, you see the Nu Html Checker page below, your document is faulty. Almost certainly, you failed to follow the instructions, i.e., you ignored the file template provided. Ensure that the Doctype directive and the meta tag included in the template are correctly placed in your document. Re-validate. 50

If "errors" are found, the validator will inform you. There is an error placed in testpage.html. Be sure to read the explanations carefully and make the repairs as necessary edit, re-save, re-upload. For your assignment, do not allow any program to correct the errors automatically. 51

Once your document is error-free, you will see this page with a green banner. Scroll down to the bottom of this page to the icon codes. 52

Copy-paste the codes as the last element of your document; save the updated version. You should validate this updated version to make sure there are no new issues. Further down the page, your will also see below. You may of course validate your CSS also but it is optional for your assignment. 53

The index.html file The file name "index.html", or "index.htm" is reserved. This is the file in a directory which will be used automatically by default if a URL ends in the directory name instead of a file name. On most servers, the use of this file as the default helps prevent unauthorized access to the directory. Some servers may have a hierarchy of default file names. 54