Introduction to HTML. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Similar documents
CSC 551: Web Programming. Spring 2004

CSC 121 Computers and Scientific Thinking

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

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

A Balanced Introduction to Computer Science, 3/E

Web Publishing with HTML

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

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

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

Html basics Course Outline

By Ryan Stevenson. Guidebook #2 HTML

Certified HTML Designer VS-1027

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

1.264 Lecture 12. HTML Introduction to FrontPage

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

A Brief Introduction to HTML

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

Certified HTML5 Developer VS-1029

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

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

Introduction to Computer Science (I1100) Internet. Chapter 7

UNIT II Dynamic HTML and web designing

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

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

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.

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

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

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 2 Test Bank

COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

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

2.1 Origins and Evolution of HTML

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

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

2.1 Origins and Evolution of HTML. 2.3 HTML Document Structure

Web Page Creation Part I. CS27101 Introduction to Web Interface Design Prof. Angela Guercio

HTML Hints & Tips. HTML is short for HyperText Markup Language.

Table Basics. The structure of an table

INFS 2150 / 7150 Intro to Web Development / HTML Programming

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

The figure below shows the Dreamweaver Interface.

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

Introduction to Computer Science (I1100) Internet. Chapter 7

Dreamweaver CS3 Concepts and Techniques

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

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 2 Test Bank

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

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

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

Using Dreamweaver CS6

Hyper Text Markup Language HTML: A Tutorial

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

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

Using Dreamweaver 2 HTML

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

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

Introduction to HTML

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

CSC Web Programming. Introduction to HTML

2.1 Origins and Evolution of HTML

Introduction to Computers and Their Applications

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

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

Shatin Tsung Tsin Secondary School S.3 Computer and Technology Web Page Design by HTML Introduction to HTML

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

Creating Web Pages. Getting Started

Web Development and Design Foundations with HTML5 8th Edition

HYPERTEXT MARKUP LANGUAGE ( HTML )

Tutorial 2 - HTML basics

How to set up a local root folder and site structure

Working with HTML. must appear at the very beginning of your webpage. starts the first section of your page

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

Programmazione Web a.a. 2017/2018 HTML5

Bixby Public Schools Course Essential Elements Grade: Desktop Publishing

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

Advanced Web Programming C2. Basic Web Technologies

WEB PAGE DESIGN. Structure

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

Dreamweaver Basics Outline

Netscape Composer Tutorial

Building Web Based Application using HTML

Bridges To Computing

Selected Sections of Applied Informatics

Basic HTML Lecture 14

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

DREAMWEAVER QUICK START TABLE OF CONTENT

CSC Web Technologies, Spring HTML Review

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

Announcements. Paper due this Wednesday

introduction to XHTML

Figure 1 Forms category in the Insert panel. You set up a form by inserting it and configuring options through the Properties panel.

Part 1: HTML Language HyperText Make-up Language

Desire2Learn: HTML Basics

Introducing Web Tables

CSCU9B2: Web Tech Lecture 1

Table-Based Web Pages

Page Layout Using Tables

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:

Layout Manager - Toolbar Reference Guide

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

Transcription:

Introduction to HTML Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Hypertext & HTML HyperText Markup Language (HTML) is the language for specifying the static content of Web pages hypertext refers to the fact that Web pages are more than just text can contain multimedia, provide links for jumping within & without markup refers to the fact that it works by augmenting text with special symbols (tags) that identify structure and content type Reference: https://www.tutorialspoint.com/html/index.htm 2

Web Development Tools Many high-level tools exist for creating Web pages e.g., Microsoft FrontPage, Netscape Composer, Adobe PageMill, Macromedia DreamWeaver, HotDog, also, many applications have "save to HTML" options (e.g., Word) for most users who want to develop basic, static Web pages, these are fine so, why are we learning low-level HTML using a basic text editor? may want low-level control may care about size/readability of pages may want to "steal" page components and integrate into existing pages may want dynamic features such as scripts or applets 3

Tags vs. Elements HTML specifies a set of tags that identify structure and content type tags are enclosed in < > <img src="image.gif" /> specifies an image most tags come in pairs, marking a beginning and ending <title> and </title> enclose the title of a page an HTML element is an object enclosed by a pair of tags <title>my Home Page</title> is a TITLE element <b>this text appears bold.</b> is a BOLD element Part of this text is <b>bold</b>. is a PARAGRAPH element that contains a BOLD element HTML document is a collection of elements (text/media with context) 4

Structural Elements an HTML document has two main structural elements HEAD contains setup information for the browser & the Web page e.g., the title for the browser window, style definitions, JavaScript code, BODY contains the actual content to be displayed in the Web page <! web1.html 03/07/2017 --> <title>title for Page</title> Text that appears in the page HTML documents begin and end with and tags Comments appear between <!-- and --> HEAD section enclosed between and BODY section enclosed between and 5

Text Layout <!-- web2.html 03/07/17 --> <title>text Layout</title> This is a paragraph of text<br/> made up of two lines. This is another paragraph with a GAP between some of the words. This paragraph is<br/> indented on the first line<br/> but not on subsequent lines. For the most part, layout of the text must be left to the browser every sequence of whitespace is interpreted as a single space browser automatically wraps the text to fit the window size Can override some text layout can cause a line break using the <br/> tag (no closing tag) can specify a new paragraph (starts on a new line, preceded by a blank line) using can force a space character using the symbol for a non-breaking space: 6

Separating Blocks of Text <!-- web3.html 03/07/17 --> <title>blocks of Text</title> <h1>major heading 1</h1> Here is some text. <h2>subheading</h2> Here is some subtext. <hr/> <h1>major heading 2</h1> Here is some more text. can specify headings for paragraphs or blocks of text <h1> </h1> tags produce a large, bold heading <h2> </h2> tags produce a slightly smaller heading... <h6> </h6> tags produce a tiny heading can insert a horizontal rule to divide sections <hr/> draws line across window <hr width="50%" /> sets width <hr size=10 /> sets thickness 7

Aligning Text <! web4.html 03/07/17 --> <title>text Alignment</title> <h1 style="text-align:center">centered Heading</h1> Here is some left-justified text (which is the default in HTML). <p style="text-align:center"> Here is some centered text. <div style="text-align:right"> <h2>right-justified Heading</h2> Here is some right-justified text. </div> can specify how elements should be aligned (default is leftjustified) utilize STYLE attribute of tag to justify more than one element as a group, use DIV tags ell elements enclosed in DIV are formatted similarly 8

Text styles <! web5.html 03/07/17 --> <title>text Styles</title> Text can be emphasized using <b>bold</b>, <i>italics</i>, or even <big>resizing</big>. <br/> The typewriter font is good for displaying code: <tt>sum = sum + i;</tt> <br /> And remember: <span style="color:red"> <small>2<sup>10</sup></small> = 1024</span> can specify styles for fonts <b> </b> specify bold <i> </i> specify italics <tt> </tt> specify typewriter-like (fixedwidth) font <big> </big> increase the size of the font <small> </small> decrease the size of the font <sub> </sub> specify a subscript <sup> </sup> a superscript <p style="color:red"> for paragraphs <span style="color:blue"> </span> for inline text Note: if elements are nested, the order of opening/closing is important! (LIFO) 9

More text grouping <! web6.html 03/07/17 --> <title>more Text Grouping</title> <tt><pre> for (i = 0; i < 10; i++) { sum = sum + i; } </pre></tt> Eagleson's Law states that: <blockquote> Any code of your own that you haven't looked at for six or more months might as well have been written by someone else. </blockquote> <pre> </pre> specify text that is to be displayed as is (line breaks and spacing are preserved) useful for code or whenever you want text to fit a specific layout <blockquote> </blockquote> specify text that is to be indented on both margins useful for quotations or for indenting text in subsections 10

Lists <!-- web7.html 03/07/17 --> <title>simple Lists</title> <ol> <li>first thing. <li>second thing. <li>third thing. </ol> <dl> <dt>html <dd>hypertext Markup Language <dt>http <dd>hypertext Transfer Protocol </dl> there are 3 different types of list elements <ol> </ol> specifies an ordered list (using numbers or letters to label each list item) <li> identifies each list item can set type of ordering, start index <ul> </ul> specifies unordered list (using a bullet for each) <li> identifies each list item <dl> </dl> specifies a definition list <dt> identifies each term <dd> identifies its definition 11

Hyperlinks <!-- web8.html 03/07/17 --> <title>hyperlinks</title> <a href="http://www.uri.edu"> University of Rhode Island</a> <br> <a href= http://egr.uri.edu/ele" target="_blank"> Department of Electrical, Computer and Biomedical Engineering</a> perhaps the most important HTML element is the hyperlink, or ANCHOR <a href="url"> </a> where URL is the Web address of the page to be displayed when the user clicks on the link if the page is accessed over the Web, must start with http:// if not there, the browser will assume it is the name of a local file <a href="url" target="_blank"> </a> causes the page to be loaded in a new window 12

Hyperlinks (Cont ) <!-- web9.html 03/07/17 --> <title>internal Links in a Page</title> <p align="center"> [ <a href="#html">html</a> <a href="#http">http</a> <a href="#ip">ip</a> <a href="#tcp">tcp</a> ] Computer acronyms: <dl> <a name="html"></a><dt>html <dd>hypertext Markup Language <a name="http"></a><dt>http <dd>hypertext Transfer Protocol <a name="ip"></a><dt>ip <dd>internet Protocol <a name="tcp"></a><dt>tcp <dd>transfer Control Protocol </dl> for long documents, you can even have links to other locations in that document <a name="ident"> </a> where ident is a variable for identifying this location <a href="#ident"> </a> will then jump to that location within the file <a href="url#ident"> </a> can jump into the middle of another file just as easily 13

Images can include images using IMG by default, browsers can display GIF and JPEG files other image formats may require plug-in applications for display <img src="filename" alt="alternate text" /> again, if file is to be accessed over the Web, must start with http:// (if not, will assume local file) <!-- web10.html 03/07/17 --> <title>images</title> <div style="text-align:center"> <img src="c:\work\uri_course teaching\ele 408 Embedded Systems\ELE 408\Lecture notes\9 Lecture 9 HTML examples\uri.png" alt= URI" width="200" height="40" > University of Rhode Island </div> 14

Tables tables are common tools for arranging complex layout on a Web page a table divides contents into rows and columns by default, column entries are left-justified, so provide for alignment <!-- web11.html 03/07/17 --> <title>tables</title> <table> <tr> <td>foo</td> <td>bar</td> </tr> <tr> <td>bizbaz</td> <td>booboo</td> </tr> </table> <table> </table> specify a table element <tr> </tr> specify a row in the table <td> </td> specify table data (i.e., each column entry in the table) 15

Layout in a table <!-- web12.html 03/07/17 --> <title>table Layout</title> <table border=1> <tr align="center"> <td>foo<br>foo</td> <td valign="top">bar</td> </tr> <tr> <td>bizbaz</td> <td>booboo</td> </tr> </table> can have a border on tables using the BORDER attribute <table border=1> increasing the number makes the border thicker can control the horizontal & vertical layout within cells <td align="center"> <td align="right"> <td valign="top"> <td valign="bottom"> can apply layout to an entire row <tr align="center"> <tr valign="top"> 16

Table Width <! web13.html 03/07/17 --> <title>table Width</title> <table width="100%"> <tr> <td>left-most <td align="right">right-most</td> </tr> </table> by default, the table is sized to fit the data can override & specify the width of a table relative to the page <table width="60%"> useful for page footer set table width to 100% 1 st column: left-justified 2 nd column: right-justified 17

Other Table Options <!-- web14.html 03/07/17 --> <title>table Formatting</title> <table border=1 cellspacing=4 cellpadding=8> <tr> <th>head1</th> <th>head2</th> <th>head3</th> </tr> <tr> <td>one</td> <td>two</td> <td>three</td> </tr> <tr> <td rowspan=2 align="center"> four </td> <td colspan=2 align="center"> five </td> </tr> <tr> <td> six </td> <td> seven </td> </tr> </table> can control the space between cells & margins within cells <table cellspacing=5> <table cellpadding=5> can add headings <th> is similar to <td> but displays heading centered in bold can have data that spans more than one column <td colspan=2> similarly, can span more than one row <td rowspan=2> 18

Frames frames provide the ability to split the screen into independent pages must define a FRAMESET that specifies the layout of the pages actual pages to be displayed must be in separate files <!-- web15.html 03/07/17 --> <frameset cols="*,*"> <frame src="page01.html"> <frame src="page02.html"> </frameset> can divide vertically <frameset cols="50%,50%"> or, horizontally <frameset rows="30%,*,*"> * causes the browser to divide the remaining space evenly by default, each frame scrollable can drag the border to resize can hide the border with frameset attribute frameborder=0 19

Menu frame to create a menu, need to be able to direct links to the main frame name the frames in the FRAMESET specify the frame name as TARGET in the link specify _top as target to return to top level of browser <!-- web16.html 03/07/17 --> <title>demo Browser</title> <frameset cols="30%,*"> <frame src="menu16.html" name="menu"> <frame src= web1.html" name="main"> </frameset> <!-- menu16.html 03/07/17 --> <title>menu of Demos</title> Links to demo pages <a href= web1.html" target="main">demo 1</a><br/> <a href= web2.html" target ="main">demo 2</a><br/> <a href= web3.html" target ="main"> Demo 3</a><br/> <a href= web4.html" target ="main"> Demo 4</a><br/> <a href= web5.html" target ="main"> Demo 5</a><br/> <a href= web6.html" target ="main"> Demo 6</a><br/> <a href="http://www.uri.edu" target="_top" >University of Rhode Island</a> 20

HTML Forms HTML Forms are required when you want to collect some data from the site visitor. A form will take input from the site visitor and then will post it to a backend application such as CGI, ASP Script or PHP script etc. The back-end application will perform required processing on the passed data based on defined business logic inside the application. Syntax: <form> </form>

HTML Form Controls Text Input Controls Checkboxes Controls Radio Box Controls Select Box Controls File Select boxes Hidden Controls Clickable Buttons Submit and Reset Button Reference: https://www.tutorialspoint.com/html/html_forms.htm

Examples Single-line text input controls <form > First name: <input type = "text" name = "first_name" /> <br> Last name: <input type = "text" name = "last_name" /> </form> Password input controls <form > User ID: <input type = "text" name = user_id" /> <br> Password: <input type = password" name = password" /> </form> Multi-line text input controls <form> Description : <br /> <textarea rows = "5" cols = "50" name = "description"> Enter description here... </textarea> </form>