Intro to Web Development HTML Structure

Slides:



Advertisements
Similar presentations
ASHIMA KALRA.  WHAT IS HTML WHAT IS HTML  HTML TAGS HTML TAGS  FORMATTING TAGS FORMATTING TAGS.
Advertisements

HTML: PART ONE. Creating an HTML Document  It is a good idea to plan out a web page before you start coding  Draw a planning sketch or create a sample.
HTML BASICS Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
Essential Tags Web Design – Sec 3-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Essential Tags Web Design – Sec 3-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
HTML. WHAT IS HTML HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup language A markup language is a set of.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
HTML 4 Foundation Level Course HyperText Markup Language Most common language used in creating Web documents. You can use HTML to create cross-platform.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
A Basic Web Page. Chapter 2 Objectives HTML tags and elements Create a simple Web Page XHTML Line breaks and Paragraph divisions Basic HTML elements.
HTML Structure & syntax. Introduction This presentation introduces the following: Doctype declaration HTML Tags, Elements and Attributes Sections of a.
L. Anne Spencer (c) 2001 Basic Web Design Document, text, & layout formatting tags & attributes.
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
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
1 Introduction to HTML. 2 Definitions  W W W – World Wide Web.  HTML – HyperText Markup Language – The Language of Web Pages on the World Wide Web.
Basic HTML Page 1. First Open Windows Notepad to type your HTML code 2.
NOTEPAD++ Lab 1 1 Riham ALSmari. Why Notepad++ ?  Syntax highlighting  Tabbed document interface  Zooming  Indentation code  Find and replace over.
HTML Structure & syntax
HTML Structure & syntax
Introduction to HTML.
Web Architecture & HTML
Web Basics: HTML/CSS/JavaScript What are they?
HTML Basics.
HTML5 Basics.
CGS 3066: Lecture 2 Web Development and HTML5
Marking Up with XHTML Tags describe how a web page should look
Bell Ringer Conduct your own research & answer the following questions (1 paragraph). What is HTML? Who developed HTML? How is it used in web design?
Introduction to basic HTML
Essential Tags Web Design – Sec 3-3
HTML Programming Basic HTML text formatting.
Elements of HTML Web Design – Sec 3-2
Creating a Web Page.
Coding, Testing and Valdating a Web Page
INTRODUCTION TO HTML AND CSS
3.00cs HTML Overview 3.00cs Develop webpages.
Web Development & Design Foundations with HTML5 8th Edition
CGS 3066: Web Programming and Design Spring 2016
Essential Tags Web Design – Sec 3-3
Chapter 1: Introduction to XHTML (part 1)
Intro to Web Development Class A Review
Elements of HTML Web Design – Sec 3-2
HTML Robert McIntosh
HTML Vocabulary.
WEBSITE DESIGN Chp 1
Computers and Scientific Thinking David Reed, Creighton University
3.02D HTML Overview 3.02 Develop webpages.
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
INTRODUCTION TO HTML AND CSS
Structuring Content in a Web Document
HTML Formatting Text.
Introduction to HTML5.
HTML Basics Web.
HTML Structure.
HTML5 Session II Chapter 2 - How to Code, Test and Validate a Web Page Chapter 3 - How to Use HTML to Structure a Web Page
Basic HTML Workshop.
Marking Up with XHTML Tags describe how a web page should look
Pertemuan 1 Desain web Pertemuan 1
HyperText Markup Language
The Most Basic HTML Page
Marking Up with XHTML Tags describe how a web page should look
3.02D HTML Overview 3.02 Develop webpages.
AN INTRODUCTION BY FAITH BRENNER
HTML Structure & syntax
Lesson 2: HTML5 Coding.
4.02A HTML Overview 4.02 Develop web pages using various layouts and technologies. (Note to instructor: HTML tags are in red only to differentiate from.
Marking Up with XHTML Tags describe how a web page should look
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
Presentation transcript:

Intro to Web Development HTML Structure

Web Page Source Code Readable by humans and machines. <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> Readable by humans and machines. Web pages are text files.

Web Page Source Code Markup is inside <>s. <!DOCTYPE html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> Markup is inside <>s. “Markup” is inside angle brackets

Web Page Source Code Text is outside <>s. <!DOCTYPE html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> Text is outside <>s.

New Lines <!DOCTYPE html>¶ <html>¶ <head>¶ <title>First HTML5 Web Page</title>¶ </head>¶ <body>¶ <p>¶ Hello, class!¶ </p>¶ ¶ Hope you enjoy the show.¶ </body>¶ </html>¶ Because it is a text file, the “new line” character(s) is interpreted to start a new line when displayed.   HTML interprets new line characters differently. HTML interprets a new line character in source code as a space.

Space Characters Whitespace characters <!DOCTYPE█html> ██<head> ████<title>First█HTML5█Web█Page</title> ██</head> ██<body> ████<p> ██████Hello,█class! ████</p> ██████Hope you enjoy the show. ██</body> </html> Whitespace characters White space characters include the space, tab, new lines and a few other characters which take up a blank character position when displayed. This is one of the defining features of “text” files.

How Browsers See HTML <!DOCTYPE█html>█<html>█<head>█<title>First█HTML5█Web█Page</title>█</head>█<body>█<p>█Hello,█class!</p>█<p>█Hope you enjoy the show.█</p>█</body>█</html> The browser converts all new line characters and tabs into white space, like the space character. Consecutive spaces are converted to a single space. All the new line characters are gone!

Where did the new lines go? <!DOCTYPE█html>█<html>█<head>█<title>First█HTML5█Web█Page</title>█</head>█<body>█<p>█Hello,█class!</p>█<p>█Hope you enjoy the show.█</p>█</body>█</html> How do we get new lines on a web page? How do we get new lines on a web page it the browsers ignore the new line characters in the source code file?

“New Lines” in HTML Some elements, like <p>, always start on a new line: HTML source file: <p>Hello, class!</p><p>Enjoy the show.</p> Browser renders as: Hello, class! Enjoy the show.

<br> in HTML The HTML element <br> (“break”) causes a new line. HTML source file: <p>Hello, class!<br>Enjoy the show.</p> Browser renders as: Hello, class! Enjoy the show.

<br> The <br> tag doesn’t have a closing element, i.e, there is no </br> in HTM5. While most tags in HTML come in opening and closing pairs, Like <html></html> and <body> and </body> , some tags, like <br>, Do not. These are called void tags. Other HTML5 void tags include <img> (image), <hr> (horizontal rule) and meta (meta information).

Enclosing Tags Elements that have opening and closing tags can contain other tags, i.e., tags can nest. <html> <head> <title>Hello!</title> </head> <body> </body> </html> html element head element title element body element

Indentation Shows Nesting Elements that have opening and closing tags can contain other tags, i.e., tags can nest. <html> <head> <title>Hello</title> </head> <body> </body> </html> html element head element title element body element

Invalid Nesting <html> <head> <body> </head> Elements cannot over lap. <html> <head> <body> </head> </body> </html> html element head element For any two elements on a web page, Either: One completely includes the other, or The other is completely separate. body element

Document Type Tag <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> First line of every web page is the DOCTYPE tag. This tell the browser what kinds of document the file is. In this, this tag means that this is an HTML5 version html text file. A web page has one and only one DOCTYPE tag, and it must be the first line. All the lines in this file are HTML EXCEPT the first, <!DOCTYPE line.

<html> Tags <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> The 2nd line of every web page is a <html> tag. The last line of the web page is the corresponding closing tag. Each web page as has one and only one pair of html tags. It tells the browser that everything between the open tag <html> and closing tag </html> is html.

<head> Tags <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> The <head> section is 1st element inside the <html> element. .

<body> Tags <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> The <body> section is 2nd element inside the <html> element. .

Opening Tag <title>First HTML5 Web Page</title> Title opening tag

Closing Tag <title>First HTML5 Web Page</title> Title closing tag

HTML Element <title>First HTML5 Web Page</title> Title HTML Element An HTML element includes: The opening tag The text between the opening and closing tag The closing tag

5 Required Web Page Elements <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html>

5 Required Web Page Elements <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> DOCTYPE

Required Web Page Elements <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> html element

Required Web Page Elements <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> head element

Required Web Page Elements <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> body element

Required Web Page Elements <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> title element

<p> Element (optional) <!DOCTYPE html> <html> <head> <title>First HTML5 Web Page</title> </head> <body> <p> Hello, class! </p> Hope you enjoy the show. </body> </html> paragraph elements

HTML5 Elements There are 112 HTML5 elements (the number slowly increases as new elements are introduced). “Learning HTML5” is learning what these 112 elements mean and how to use them on a web page. So far, we have introduced five elements: <html> <head> <body> <title> <p>

HTML5 Elements The <html> </html> tags form a container for all the html markup and text on the page, i.e., the html element IS the entire web page. The html element contains two elements, the <head> element and the <body> element. The <head> element contains information about the web page, i.e., “meta” information, but not any contents of the page itself. The <body> element contains the information to be displayed in the browser window. The <p> (paragraph) element contains a paragraph of text.

HTML Attributes <html lang="en"> Element Attribute Attributes are only allowed in opening HTML tags An opening tag may contain zero, one or many attributes. If there is more than one attribute, they are separated by spaces. Attribute format: attrib=“value”.

Attribute Examples <html lang="en"> <meta charset="utf-8"> <link rel="stylesheet" href="reset.css"> <div id="container"> <section id="logo">

Coding Standards html tag names always in lower case. attribute names always in lower case. attribute values always in double quotes. Indent code when an element is "inside" another element. Use only two spaces for indentation.