CGS 3066: Web Programming and Design Spring 2016

Slides:



Advertisements
Similar presentations
Table, List, Blocks, Inline Style
Advertisements

HTML popo.
HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.
CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
HTML: HyperText Markup Language Hello World Welcome to the world!
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
Introduction to HTML II Shih-Heng Chin. Preface Structure of a HTML File Elements used frequently Tables.
Basics of HTML Shashanka Rao. Learning Objectives 1. HTML Overview 2. Head, Body, Title and Meta Elements 3.Heading, Paragraph Elements and Special Characters.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) HTML Basics James Wang.
Programming I 2 nd lecture. Block-level and inline elements BlockInline block-level elements generally can contain text, data, inline elements, or other.
HTML HTML stands for "Hyper Text Mark-up Language“. Technically, HTML is not a programming language, but rather a markup language. Used to create web pages.
HTML (HyperText Markup Language)
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
HTML history, Tags, Element. HTML: HyperText Markup Language Hello World Welcome to the world!
 2002 Prentice Hall, Inc. All rights reserved.2 Chapter 2 — Introduction to HyperText Markup Language 4: Part I Outline 2.1Introduction 2.2Markup Languages.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
CS105 INTRODUCTION TO COMPUTER CONCEPTS HTML Instructor: Cuong (Charlie) Pham.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
HTML: Hyptertext Markup Language Doman’s Sections.
Ali Alshowaish. What is HTML? HTML stands for Hyper Text Markup Language Specifically created to make World Wide Web pages Web authoring software language.
Introduction to HTML Xiangming Mu 9/23/ Learning Objectives Understand basic HTML tags and their attributes Learn to create a simple HTML page.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
1999, COMPUTER SCIENCE, BUU Introduction to HTML Seree Chinodom
INT222 – Internet Fundamentals
01 – HTML (1) Informatics Department Parahyangan Catholic University.
HTML Structure & syntax
Fall 2016 CSULA Saloni Chacha
HTML Basics.
CGS 3066: Lecture 2 Web Development and HTML5
Web Development Part 1.
Web Development & Design Foundations with HTML5 8th Edition
LAB Work 01 MBA 61062: E-Commerce
Marking Up with XHTML Tags describe how a web page should look
Lecturer (Dept. of Computer Science)
HTML: HyperText Markup Language
Elements of HTML Web Design – Sec 3-2
HTML5 – Heading, Paragraph
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Chapter 1: Introduction to XHTML (part 1)
AN INTRODUCTORY LESSON TO MAKING A SIMPLE WEB PAGE By: RC Emily Solis
The Web Warrior Guide to Web Design Technologies
Introduction to XHTML.
Elements of HTML Web Design – Sec 3-2
Chapter 4 - Introduction to XHTML: Part 1
Web Programming– UFCFB Lecture 5
COMPUTING FUNDAMENTALS
WEBSITE DESIGN Chp 1
(HTML tags can be referred from
Computers and Scientific Thinking David Reed, Creighton University
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
CGS 3066: Lecture 2 Web Development and HTML5
1 Introduction to XHTML.
Introduction to HTML- Basics
Introduction to XHTML Cont:.
Html.
Introduction to HTML.
Computer communications
Marking Up with XHTML Tags describe how a web page should look
CS3220 Web and Internet Programming HTML and XML Basics
Marking Up with XHTML Tags describe how a web page should look
Lesson 2: HTML5 Coding.
Web Client Side Technologies Raneem Qaddoura
Marking Up with XHTML Tags describe how a web page should look
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

CGS 3066: Web Programming and Design Spring 2016 Department of Computer Science, Florida State University

Introduction to HTML Acronym for HyperText Markup Language Primary language of the World Wide Web since its inception Tells the web browser what content to display, how to display Allows separation of content and presentation https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Introduction

History of HTML First introduced in 1991 by Tim Berners-Lee same person invented the world wide web(WWW) in 1989, built the first web browser, and the first web server running HTTP protocol  Currently maintained by World Wide Web Consortium (W3C) Major revisions: HTML 3.2(1997), HTML 4.01(1999) The latest standard is HTML5(2014) All major browsers support most of the HTML5 elements Full specification: https://www.w3.org/TR/html5/ revised, extended over time

HTML Example <!DOCTYPE html> <html> <head> <title>Hello World</title> </head> <body> <p>Our first paragraph!</p> </body> </html>

HTML Page Structure <html> <head> <title>Hello World </title> </head> <body> <p> Our first paragraph! </p> </body> </html>

Tree structure of HTML html head body title p

<!DOCTYPE> Declaration Tells browser which HTML standard to expect. Must appear first in the HTML document. HTML5 has a very simple <!DOCTYPE> element. <!DOCTYPE html> HTML4 <!DOCTYPE> element <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

Basics of HTML5 Every HTML document (web page) consists of tags and character data. Tags are elements enclosed in angle brackets. <html>, <body>, <a> </a> </body>, </html>, Opening and ending tags must be used together. Character data is the content between an opening and closing tag. <title>Hello World</title>

HTML Element An element is a combination of a tag and its character data. <title>Hello World</title> <body><p>Welcome to the world></p></body> <a href=“www.google.com”> Google </a> <br>

HTML Element(contd.) It is possible to nest elements inside other elements No Overlapping of tags! It is possible to have empty element (no content/character data). HTML tags are not case sensitive. <A> and <a> are the same.

Attributes Attributes provide information about HTML elements. An element can have one or more attributes. id class style href Attributes come in name/value pairs. <a href=“www.google.com”>Go to Google’s website</a>

Attributes(Contd.) Some attributes can be used on any HTML element: class: specifies one or more class names for an element (refers to a class in a style sheet). id: specifies a unique id for an element. style: specifies an inline CSS style for an element. title: specifies extra information about an element.

Headings Heading are used to show the document structure. <h1>, <h2>, <h3>, <h4>, <h5>, <h6> <h1> defines the most important heading and <h6> defines the least important heading. Browsers automatically add some empty space before and after each heading.

Comment Comments can be added into the HTML code to make it readable and understandable. Browsers will not display any comments. Syntax: <!-- --> E.g., <!-- This is my comment --> Comments cannot be nested! E.g., <!-- This is a <!-- wrong --> way to write comment -->

Paragraph Paragraphs are defined with the <p> tag. Browsers automatically add an empty line before and after a paragraph May not contain block-level elements such as tables, headings,lists, pre-formatted text, another paragraph etc.

Formatting You cannot change the output by adding extra spaces or lines in HTML code. Browsers treat multiple consecutive whitespaces/line breaks as a single space To go to a new line within a paragraph, use Line-break element <br> To add whitespace: type  

HTML Entity Some characters (i.e. <, >,&) have special meaning in HTML and therefore, cannot be typed in as web content “as is” Need to use alternate string representations, called entities Also required to print non-keyboard characters An entity starts with an ampersand, ends with a semicolon

Non-breaking space character HTML Entity examples For a complete list of character entities: http://dev.w3.org/html5/html-author/charref Entity Name Result   Non-breaking space character & & < > &quote; " © ©

Special formatting tags Certain text usually has a conventional formatting, HTML has a few special formatting tags, useful to embed computer code. <pre> - for preformatted text. Forces the browser to render white space as-is. <kbd> - for specifying keyboard input. <code> - for specifying computer code. Monotype font. Ignores whitespace.

Text Formatting in HTML A list of formatting tags: <b>: print bold-faced text <i>: print italicized text <u>: underline text (discouraged for styling!) <sub>: subscripted text <sup>: superscripted text <mark>: defines marked/highlighted text <hr>: draws a horizontal line (empty element)

Hyperlinks Defined by the <a> (anchor) element A hyperlink is a clickable character string or image that, once clicked, navigates to another context. E.g., <a href=“http://www.google.com”>Go To Google </a> The href attribute indicates the link’s destination: A different website: “http://www.my.fsu.edu” Another file within the same website: “page2.html” Jump to an element with a specified id within the page: “#section4” “#” jumps to the top of the same page

Hyperlinks(contd.) The target attribute specifies where to open the linked document. _blank: in a new window or tab _self: in the same frame as it was clicked (default)

Images <img> tag is always an empty tag. It contains attributes and has no closing tag. src attribute is the URL of the image. Syntax: <img src=“sampleImage.JPEG” alt=“hint”> alt defines the text for an image when the image cannot be displayed. The width and height attributes define the size of the image.

HTML <table> Element A table consists of rows <tr>. Each row is divided into data cells <td> (td stands for table data) A <td> tag can contain text, links, images, lists, forms, and other tables.

Table Example <table> <tr> <td>row 1, cell 1</td> <td>row 2, cell 2</td> </tr> <td>row 2, cell 1</td> </table>

Table Border Attribute By default, the table will be displayed without borders. If you want borders, specify the border attribute: <table border=“1”> … </table> Not recommended, CSS should be used instead

Table Headers <tr> <th>header 1</th>

Table colspan and rowspan Attribute Can be applied to both <th> and <td> elements colspan attribute makes a cell span multiple columns rowspan attribute makes a cell span multiple rows Example: <tr> <td COLSPAN="2"> row 1 cell 1,2</td> </tr> <td>row 2, cell 1</td> <td ROWSPAN="2">row 2,3 cell 2</td> <td>row 3, cell 2</td>

HTML Lists Lists can be ordered and unordered. An unordered list starts with the <ul> tag. An ordered list starts with the <ol> tag. Each item starts with the <li> tag. Example: <ul> <li>Red</li> <li>Yellow</li> </ul>

Description List A description list is a list of items with a description of each term/name.(i.e. a Glossary/dictionary) <dl> tag defines a description list. <dt> used to write a Definition Term. Must be within a <dl> element <dd> used to write Term Description. Must follow a <dt> <dl> <dt>Coffee</dt> <dd>- a hot beverage</dd> </dl>

HTML List Tags <ol>: defines an ordered list. <ul>: defines an unordered list. <li>: defines a list item. <dl>: defines a description list. <dt>: defines an item in a description list. <dd>: defines a description of an item in a description list.

Block and Inline Elements HTML elements are defined as block level element or as inline element. Block level Elements start with a new line. E.g., <p>, <table>, <div> Inline elements are displayed without a new line. E.g., <b>, <td>, <a>, <img>

<span> element <span> element is an inline element that can be used as a container for text. <span> element usually is used to set style to parts of the text. <p>My mother has <span style="color:blue">blue</span> eyes.</p>

<div> element The <div> tag defines a division or a section in an HTML document. The <div> tag is used to group block-elements to format them with CSS. <div > <h3>This is a heading in a div element</h3> <p>This is some text in a div element.</p> </div>

HTML <meta> tag provides metadata about the HTML document Always put inside <head> element displays nothing, but readable by parsers(e.g. search engines) used to specify page description, keyword, author info etc Also used to specify character encoding: HTML5: <meta charset=“UTF-8”> HTML4: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> Other encoding options (e.g. “ansi”)available. However, W3C recommends UTF-8