CS3220 Web and Internet Programming HTML and XML Basics

Slides:



Advertisements
Similar presentations
Web Development & Design Foundations with XHTML
Advertisements

HTML: HyperText Markup Language Hello World Welcome to the world!
1 HTML Standards & Compliance. 2 Minimum Required HTML tags: (must go in this order!)
 2003 Prentice Hall, Inc. All rights reserved. Chapter 4 - Introduction to XHTML: Part 1 Outline 4.1 Introduction 4.2 Editing XHTML 4.3 First XHTML Example.
 2004 Prentice Hall, Inc. All rights reserved. Introduction to XHTML: Part 1.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 4 - Introduction to XHTML: Part 1 Outline 4.1 Introduction 4.2 Editing XHTML 4.3 First XHTML Example.
Basics of HTML Shashanka Rao. Learning Objectives 1. HTML Overview 2. Head, Body, Title and Meta Elements 3.Heading, Paragraph Elements and Special Characters.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
1 WWW/HTML Basics CS What is the WWW? Perspective for this lecture A distributed document delivery system Uses a client-server model Main presentation.
HTML (HyperText Markup Language)
HTML history, Tags, Element. HTML: HyperText Markup Language Hello World Welcome to the world!
1 HTML intro The development of HTMLThe development of HTML The transition from HTML to XHTMLThe transition from HTML to XHTML XHTML syntax, tags, and.
CS134 Web Design & Development Creating a Basic Web Page Exerted from Mehmud Abliz slides.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
HTML Hyper-Text Markup Language or tags. HTML is a “tag” language Open and close tags Tags identified with angle brackets Basic format content (shorthand.
INTRODUCTION. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language,
INTRODUCTORY Tutorial 1 Using HTML Tags to Create Web Pages.
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.
Web Development & Design Foundations with XHTML Chapter 2 HTML/XHTML Basics.
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
WEB DESIGN AND PROGRAMMING Introduction to XHTML.
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
Introduction to XHTML 1 Chapter 4 Introduction to XHTML: Part 1 Reference From: Internet & World Wide Web: How to Program Deitel, Deitel & Goldburg.
Objective: To describe the evolution of the Internet and the Web. Explain the need for web standards. Describe universal design. Identify benefits of accessible.
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
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
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
INT222 – Internet Fundamentals
Tutorial #1 Using HTML to Create Web Pages. HTML, XHTML, and CSS HTML – HyperText Markup Language The tags the browser uses to define the content of the.
TNPW1 Ing. Jiří Štěpánek.  Tags  Marks for elements ▪ Pair ▪ Start and end tag ( Paragraph text ) ▪ Single ▪ Only start tag, according to XHTML 1.0.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
HTML Structure & syntax
Basic concepts of web design
Introduction to HTML5.
HTML CS 4640 Programming Languages for Web Applications
HTML Basics.
HTML basics
CS3220 Web and Internet Programming HTML and XML Basics
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
CGS 3066: Lecture 2 Web Development and HTML5
CIS 228 The Internet 9/20/11 XHTML 1.0.
Web Development & Design Foundations with HTML5 8th Edition
LAB Work 01 MBA 61062: E-Commerce
Computer Fundamentals 2
HTML: HyperText Markup Language
Elements of HTML Web Design – Sec 3-2
Coding, Testing and Valdating a Web Page
3.00cs HTML Overview 3.00cs Develop webpages.
CGS 3066: Web Programming and Design Spring 2016
Chapter 1: Introduction to XHTML (part 1)
Elements of HTML Web Design – Sec 3-2
Chapter 4 - Introduction to XHTML: Part 1
COMPUTING FUNDAMENTALS
HTML – Organizing Page Content
HTML Intro.
HTML5 Level I Session II Chapter 3 - How to Use HTML to Structure a Web Page
CGS 3066: Lecture 2 Web Development and HTML5
HTML ELEMENTS Ms. Olifer.
Introduction to HTML- Basics
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
WWW/HTML Basics.
WWW/HTML Basics CS 4173.
Lesson 2: HTML5 Coding.
WJEC GCSE Computer Science
HTML CS 4640 Programming Languages for Web Applications
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

CS3220 Web and Internet Programming HTML and XML Basics Chengyu Sun California State University, Los Angeles

HTML HyperText Markup Language, the language for creating web pages <head><title>CS3220</title></head> <body> <h2>Welcome to CS3220!</h2> </body> </html>

XML Extensible Markup Language, the general-purposed language to describe structured data <user> <name>Chengyu Sun</name> <office>ET A317</office> <phone>(323) 343-6697</phone> </user>

A Brief History of HTML and XML Early markup languages (1960s to 1980s) SGML (early 1980s) HTML (1991) XML (1998) HTML 4.01 (1999) XHTML 1.0 (2000) HTML 5 (2014)

An XML Example <?xml version="1.0" encoding="UTF-8"?> <user type=“faculty”> <name>Chengyu Sun</name> <office>ET A317</office> <phone ext=“6697” /> </user>

Some Terminology Declaration Tag Element Opening (start) tag Closing (end) tag Element Content, attribute Empty element (i.e. no content) Root element

What About Encoding? An encoding is a way to represent characters in a computer as a sequence of 0’s and 1’s For more details, please read this Or, just remember always use UTF-8

NOT Well-Formed XML <?xml version="1.0" encoding="UTF-8"?> <users> <user type=“faculty”> <name>Chengyu Sun</Name> <office>ET A317</office> <phone ext=“6697”> </user> <name>Raj Pamula</name> <office>E&T A324</office> </users>

Validity of XML Q: How can we decide if some well-formed XML is valid (i.e. correct)? A: We need a “specification” of the elements used in the XML.

Specify XML Grammar – DTD Document Type Definition DTD Example - http://www.w3schools.com/xml/xml_dtd_examples.asp

Reference DTD in XML Reference a “private” DTD (DTD intended for use by a single author or a group of authors) <!DOCTYPE root_element SYSTEM "DTD_location"> Reference a “public” DTD <!DOCTYPE root_element PUBLIC "DTD_name" "DTD_location">

DOCTYPE Examples Private DTD Public DTD <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE user SYSTEM “mydtd.dtd”> <user type=“faculty”> <name>Chengyu Sun</name> <office>ET A317</office> <phone ext=“6697” /> </user> Public DTD See https://www.w3schools.com/tags/tag_doctype.asp

XML Recap Terminology Well-formedness Validity DTD and <!DOCTYPE>

Structure of an HTML Page DOCTYPE Declaration <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CS3220</title> </head> <body> <h2>CS3220</h2> </body> </html> Head Section <html> Root Element Body Section

DOCTYPE Declaration Indicates which version of HTML/XHTML the document uses Common DOCTYPE declarations HTML 4.01 Strict HTML 4.01 Transitional XHTML 1.0 Strict XHTML 1.0 Transitional HTML 5

What About Well-formedness of HTML? HTML (not XHTML) is more forgiving Tag and attribute names are case-insensitive Some tags are self closing, e.g. <meta> and <br> Some closing tags are optional, e.g. <p>, and even <html>, <head>, <body>

<head> Section Contain elements that provide information about the web page rather than the content of the page <title> - title for the browser tab <meta> - metadata about the page <link> - mostly used for style sheets

<body> Section Contain elements that will be displayed in the browser window

Tools for HTML Development Text editors for developers Sublime Text Visual Studio Code by Microsoft Atom by GitHub IDEs Visual Studio Eclipse Professional tools for web designers like Adobe Dreamweaver

Using VS Code File, folder, and workspace Auto Save Recommended extensions HTMLHint Emmet - https://emmet.io/ html:5 +, >, and * lorem

Headings and Paragraphs <h1>, <h2>, …, <h6> <p> A block element always starts on a new line and can contain other elements

Other Commonly Used Block Elements … <pre> - preformatted text, i.e. whitespaces and line breaks are preserved <blockquote> <div> - a general-purposed block element used to structure a page into logical divisions that can be formatted, positioned, and/or processed.

… Other Commonly Used Block Elements <ul> - unordered list <ol> - ordered list <li> - list item

Common Inline Elements <i> - italic, <b> - bold, <u> - underlined <em> - emphasized <strong> - strongly emphasized <code> - for computer code <span> - a general-purposed inline element (like an inline version of <div>) <br> - line break

Anchor <a> Creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL. <a href=“http://www.calstatela.edu”>CSULA</a> URL

Absolute and Relative URLs Absolute URL http://www.calstatela.edu/logo.gif Relative URL logo.gif img/logo.gif /logo.gif /img/logo.gif ./logo.gif ../logo.gif ../img/log.gif

Link to Locations within a Page <a href=“#section1”>Introduction</a> <a href=“#section2”>HTML Basics</a> … <h2 id=“section1”>Introduction</h2> <p>…</p> <h2 id=“section2”>HTML Basics</h2>

Some Core Attributes Attributes that are common to all HTML elements id: a unique identifier for the element title: additional information about the element class: CSS class style: inline CSS style More at https://www.w3.org/TR/2012/WD-html-markup-20121011/global-attributes.html

Other Uses of <a> Email link <a href="mailto:csun@calstatela.edu">Email Me</a> Phone link <a href=“tel:+1-323-343-6697">Call me</a>

Image <img> Attributes src: URL to the image alt: alternate text if the image cannot be displayed height and width in pixels JPEG, GIF, PNG, SVG images are supported by most browsers Clickable image??

HTML Special Characters (HTML Entities) White space:   <: < >: > &: & More at http://www.w3schools.com/html/html_entities.asp

HTML Comment The syntax for comments is the same for both XML and HTML <!-- This is a single-line comment. --> <!-- This is a multi-line comment. --> The syntax for comments is the same for both XML and HTML

HTML Recap Basic page structure Block elements Inline elements <a> and <img> Absolute and relative URL Special characters Comment