HTML – Introduction to the Code

Slides:



Advertisements
Similar presentations
HTML popo.
Advertisements

Web Development & Design Foundations with XHTML
Elder L. Lionel Kendrick Of the First Quorum of the Seventy It has been from the beginning and it will be till the end that the natural man will have a.
Chapter 2 HTML Basics Key Concepts
1. Content – Collective term for all text, images, videos, etc. that you want to deliver to your audience. 2. Structure – How the content is placed on.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 3: XHTML Coding © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page.
Site Development Foundations © 2004 ProsoftTraining All rights reserved.
HTML and Web Page Design Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
Developing a Basic Web Page with HTML
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Chapter 14 Introduction to HTML
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Creating Web Pages with HTML
Creating a Simple Page: HTML Overview
Principles of Web Design 6 th Edition Chapter 1 – HTML5.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Creating a Basic Web Page
Week 1.  Phillip Chee   Ext.1214 
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Today’s objectives  Complete web page  Using xhtml & CSS  Adding CSS to documents Embed url(File);  CSS.
Lesson 4: Using HTML5 Markup.  The distinguishing characteristics of HTML5 syntax  The new HTML5 sectioning elements  Adding support for HTML5 elements.
HTML (HyperText Markup Language)
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Week 1 Understanding the Web Design Environment. 1-2 HTML: Then and Now HTML is an application of the Standard Generalized Markup Language Intended to.
CS134 Web Design & Development Creating a Basic Web Page Mehmud Abliz.
Chapter 1 XHTML: Part I The Web Warrior Guide to Web Design Technologies.
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.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
3 XHTML.
1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer Foundations: Using XHTML Chapter 2 Key Concepts.
Copyright © 2013 MyGraphicsLab / Pearson Education STRUCTURE AND HTML TAGS MyGraphicsLab: Adobe Dreamweaver CS6 ACA Certification Preparation for Web Communication.
 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: Hyptertext Markup Language Doman’s Sections.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
Web Development & Design Foundations with XHTML Chapter 2 HTML/XHTML Basics.
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
1 Web Application Programming Presented by: Mehwish Shafiq.
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.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Basic Document Structure.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
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.
Basic HTML Document Structure. Slide 2 Goals (XHTML HTML5) XHTML Separate document structure and content from document formatting HTML 5 Create a formal.
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
Web Design Principles 5 th Edition Chapter 3 Writing HTML for the Modern Web.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
HTML Basics.
Web Development & Design Foundations with HTML5 8th Edition
AN INTRODUCTORY LESSON TO MAKING A SIMPLE WEB PAGE By: RC Emily Solis
Introduction to XHTML.
HTML – Organizing Page Content
Basic HTML Document Structure
Cascading Style Sheets
Understand basic HTML and CSS terminology, concepts, and basic operations. Objective 3.01.
Lesson 2: HTML5 Coding.
Presentation transcript:

HTML – Introduction to the Code

WEB PAGE A plain text document (no specific software needed) HTML Tags - describes a documents structure Saved with .htm or .html extension Hosted on a server

HTML: Hypertext Markup Language Simple, universal mark-up language used to publish content on the web Standard mark-up language for web pages Uses tags to identify content : <p> I am a paragraph </p> HTML: basic structure Enhanced & Modified by other technologies CSS: presentation, formatting, layout JavaScript: control behavior of page elements PHP: powerful applications/functionality (backend) CMS: manage site content

HTML Elements (container tags – markup + content) Empty Tags (standalone)

HTML HTML Markup Element HTML Tags placed in angle brackets <> Consist of two tags: Opening tag | Closing tag (“on” & “off”) End tag begins with a slash ( / )

HTML Empty Tag (Standalone) Do not have text content Places an element on the page (provides a directive) Indicated by single tag XHTML note: all standalone tags require closing tag (ex: <br> now <br />)

HTML Attributes: Information or instructions that modify a tag Attributes use values Located in the opening tag One tag can have multiple attributes

HTML

HTML Basic HTML Structure 1) <!DOCTYPE html> identifies the document as an HTML document 2) <html>…</html> (root element) First and last tag in a document 3) <head>…</head> Includes descriptive info about your document | Non visual elements (metatags, links to external resources, scripts or internal resources) 4) <meta charset= “utf-8”> character encoding 5) <title>…</title> Name of page (bookmarks, browser indexing) 6) <body>…</body> Contains visual & structural elements (visible on page)

HTML4.01|XHTML1.1|HTML5|HTML?? the many flavors of HTML….

HTML Versions Many versions of HTML Tim Berners-Lee Simple, text-only browsing & authoring system to share and manage information using the hypertext process to link to related documents Handful of tags Web content grew (Browsers made a mess of things) Browser developers implemented new features and new tags into their browsers HTML continued to grow – new, cool, exciting tags (<background>, <font>, <bgsound>, <blink>, <image>) Each browser created its own proprietary tags – only supported by that particular platform W3C stepped in to help (http://www.w3.org/) Oversees ongoing development of the web Keeps track of browser features Help develop guidelines for common HTML language (HTML 3.2 - 1996) (versions:http://www.utoronto.ca/webdocs/HTMLdocs/HTML_Spec/html.html)

HTML Versions HTML 2.0 - specification released in 1995 HTML tags - informal CERN document listing 12 tags (1991) HTML 2.0 - specification released in 1995 HTML 3.2 - first version developed and standardized exclusively by the W3C (1996) HTML 4.0 - published as W3C recommendation (1997) HTML 4.01 - published as W3C recommendation (1999) XHTML 1.0 - published as W3C recommendation (2000) More structure less presentation (XML based approach) XHTML 1.1 - published as W3C recommendation (2001) XHTML 2.0 - NO STANDARD (2002-2009) worked on but abandoned – not backward compliant (new language) HTML 5 – WHATWG (Web Hypertext Application Tech Working Group) (2004) W3C adopts the work of this group under name HTML 5.0 (2006) Working Draft (2007)

HTML vs. XHTML XML - Extensible Markup Language A metalanguage for creating markup languages custom markup language to describe all sorts of information (chemical notation, mathematical equations, multimedia presentations, financial information) W3C Vision XML-based Web with many specialized markup languages working together. Enter XHTML - Extensible Hypertext Markup Language HTML rewritten according to the rules of XML (so that it would be compatible with other xml markup)

HTML vs. XHTML XHTML - Extensible Hypertext Markup Language Markup language almost identical to HTML – written with different rules Allows for the markup of text, inclusion of images, and is capable of linking documents together XHTML 1.0/1.1 XHTML is HTML 4.01 Reformatted using the syntax of XML HTML 4.01 – Emphasized the separation of presentation from content structure (presentation handled by CSS) XHTML follows the more structured and rigid XML rules and syntax guidelines enables one document to be viewed on multiple devices (web browsers, cell phones, PDAs, etc) by creating different style sheets for each device. HTML V5 and XHTL V2 Explained: http://www.ibm.com/developerworks/library/x-html5xhtml2.html

HTML vs. XHTML Syntax Differences All elements must be terminated (close tag) (Ex: <p> This is XHTML code! </p>) Empty tags must be terminated (close tag) written with a space and / symbol at the end (ex: <br />) All elements and attributes must be in lowercase All attribute values must be contained within quotes All elements must be nested properly

XHTML what does it look like? <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=“http://www.w3.org/1999/xhtml”> <head> <title>Untitled Document</title> </head> <body> This is where the content of your page will be placed. </body> </html>

XHTML what does it look like? <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> DOCUMENT TYPE DECLARATION (DOCTYPE): Defines all elements and attributes in the language & their rules (Identifies which version of html the document follows) Points to a file that outlines the available structure, elements, attributes, and their appropriate usage (URL to a Doc Type Definition (DTD) – machine readable file)

DOCUMENT TYPE DEFINITION Transitional: maintains backward compatibility with older browsers includes legacy elements – obsolete (deprecated) elements (includes presentation elements that were in common use) Strict: doesn’t allow any HTML elements that were designed to control the appearance of a page. (omits all deprecated elements) Frameset: allows HTML elements needed to create framesets. Great explanation can be found at: Child, D. (2004) DTDs Explained, Added Bytes Available: http://www.addedbytes.com/html/dtds-explained/ Validators Checks the markup to see if its following the rules specified in the DOCTYPE declaration. Niederst, J. (2012) Learning Web Design. O’Reilly Media, Inc. Chapter 10: What's Up, HTML5

XHTML what does it look like? <html xmlns= http://www.w3.org/1999/xhtml lang=“en” xml:lang=“en”> XML namespace= This URL points to a file that gives detailed information about the particular XML vocabulary used on the page.

XHTML what does it look like? <head> contains all the header information <title> defines the page title </title> </head> closing head tag <body> where all visible content will be placed </body> closing body tag </html> closing html tag

HTML Versions HTML 2.0 - specification released in 1995 HTML tags - informal CERN document listing 12 tags (1991) HTML 2.0 - specification released in 1995 HTML 3.2 - first version developed and standardized exclusively by the W3C (1996) HTML 4.0 - published as W3C recommendation (1997) HTML 4.01 - published as W3C recommendation (1999) XHTML 1.0 - published as W3C recommendation (2000) More structure less presentation (XML based approach) XHTML 1.1 - published as W3C recommendation (2001) XHTML 2.0 - NO STANDARD (2002-2009) worked on but abandoned – not backward compliant (new language) HTML 5 – WHATWG (Web Hypertext Application Tech Working Group) (2004) W3C adopts the work of this group under name HTML 5.0 (2006) Working Draft (2007)

HTML 5 Timeline Can you use it now? – Yes, some parts of HTML 5 2003 – HTML 5 development begins 2007 Oct - First W3C Working Draft 2009 Oct – Last Call Working Draft 2011 – Call for contributions for the test suite 2012 – First draft of test suite 2015 – Second draft of test suite 2019 – Final version of test suite 2020 – Reissued last call working draft 2022 – Proposed Recommendation Ian Hickson, editor of HTML 5 Specification (Tech Republic Interview 2008) Can you use it now? – Yes, some parts of HTML 5 User agents (devices & browsers) provide some support now Entire specification not yet ready for adoption – but some parts are ready to use now Support Resources : http://findmebyip.com | http://samples.msdn.microsoft.com/ietestcenter/ | http://canisue.com |http://html5test.com

HTML 5 vs HTML 4 Differences No Doctype needed <!DOCTYPE HTML> Character Encoding: <meta charset=“UTF-8” /> New Elements: article, aside, audio, canvas, command, datalist, details, embed, figcaption, figure, footer, header, hgroup, keygen, mark, meter, nav, output, progress, rp, ruby, section, source, summary, time, video Forms: more powerful form elements(built in validation) Integrated APIs (Application Programming Interfaces): Easier to develop web applications across multiple devices. (API = a documented set of commands, data names – lets one software app communicate with another)

Back to the Code <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=“http://www.w3.org/1999/xhtml”> <head> <title>Title of Document</title> </head> <body> This is where the content of your page will be placed. </body> </html>

HTML Common Elements Block & Inline Elements Block Elements Ex: <p /> <h1>…</h1> Each block element begins a new line Have space above and below the element by default <h1> This is the most important heading </h1> <p> This is a paragraph </p> Inline Elements Ex: <em>…</em> Flow within other elements (do not start new line) <p> This is a paragraph with <em> emphasized text </em> within (inline) the paragraph element </p>

HTML Block Level Elements Paragraphs <p>…</p> Headings <h#>…</h#> (six levels of headings) provides logical hierarchy improves accessibility Block quote <blockquote>…</blockquote> Preformatted text <pre>…</pre> preserves white spaces – returns and character spaces May be needed to convey meaning (code, poetry) Horizontal Rules <hr />

HTML Block Level Elements Unordered Lists <ul>…</ul> & <li>…</li> Default is disc change type: <ul type=“circle”>, “square” Ordered Lists <ol>…</ol> & <li>…</li> Default is #’s change type: <ol type=“A”> “a”, “I”, “i” Definition Lists <dl>…</dl> & <dt>…</dt> & <dd>…</dd> Note: Changing type and start value not supported in “strict” versions of XHTML http://www.w3schools.com/html/html_lists.asp

HTML Inline Elements Line Breaks <br /> Semantic inline text elements Describes the meaning of the text Examples: <em>for emphasis, <strong> strongly emphasized, <q> short inline quote Presentational inline text elements provides descriptions of the elements style Examples: <b> keywords or visually emphasized text (bold) Ex: product name, <i> Alternative voice (italics) Ex: phrase, technical term, thought (please use: <strong> & <em> instead)

HTML Special Characters Must use numeric or named character reference Examples Character space ( ) & Ampersand (&) © Copyright symbol (©) Euro (€)

Meaningful Markup Semantic Markup Semantic Markup uses tags or elements that describe the content by its function. Adds meaning for the machine Browsers, mobile devices, screen readers, search engines can not “see” the page… they extract meaning and context from the markup.

Meaningful Markup – No Presentation Info <h1>This is the most important headline</h1> <p>This is ordinary paragraph text within the body of the document, where certain words and phrases may be <em>emphasized</em> to mark them as <strong>particularly important</strong>.</p> <h2>This is a headline of secondary importance to the headline above</h2> <p>Any time you list related things, the items should be marked up in the form of a list:</p> <ul> <li>A list signals that a group of items are conceptually related to each other</li> <li>Lists may be ordered (numbered or alphabetic) or unordered (bulleted items)</li> <li>Lists may also be menus or lists of links for navigation </li> <li>Cascading Style Sheets can make lists look many different ways</li> </ul> Browsers, mobile devices, screen readers, search engines can not “see” the page… they extract meaning and context from the markup. The Site Development Process http://webstyleguide.com

HTML Images img tag <img> Required attribute: src <img src=“uwm_logo.gif” alt=“UWM Logo” /> http://www.w3schools.com/html/html_images.asp

HYPERTEXT – it’s a web… things are linked…

HTML Links The anchor <a>…</a> Required attribute: href <a href=http://www.uwm.edu> Link to UWM </a> <a href=http://www.uwm.edu><img src=“uwm_logo.gif”/>UWM</a>

6,100 Files 250 Folders Site Directory and File Structure Often mirrors visible site structure Logical naming conventions – plain language Creates useful/understandable URLs 6,100 Files 250 Folders

Hypertext – Absolute & Relative Links Absolute Links <a href=“http://www.uwm.edu”> UW-Milwaukee </a> also called an external link Relative Links <a href=“admissions.html”> Link to admissions page </a> Relative links do not require the protocol and domain name These links are “related” to the current page (The page you want to link to is within the same domain as the document you are linking from)

<a href=“index.html”> HOME </a> If you were working on your about.html document and you wanted to create a link to your index.html document, your link would look like this: <a href=“index.html”> HOME </a>

<a href=“academics/advising.html”> Advising</a> If you were working on your index.html document and you wanted to create a link to your advising.html document, your link would look like this: <a href=“academics/advising.html”> Advising</a>

<a href=“academics/graduate/comps.html”> Comps </a> If you were working on your root level (main) index.html document and you wanted to create a link to your comps.html document, you link would look like this: <a href=“academics/graduate/comps.html”> Comps </a>

Index?? Significance of “index” Usually the default filename a browser will look for if no filename is provide. http://www.sois.uwm.edu/EPub/Spring_2012 retrieving a file called “index.html” in the Spring_2012 folder

<a href=“../advising.html”> Advising</a> If you were working on your mlis.html document and you wanted to create a link to your advising.html document, your link would look like this: <a href=“../advising.html”> Advising</a>

<a href=“../../index.html”>Back to Home</a>

CSS – Presentation of Information

Meaningful Markup – No Presentation Info <h1>This is the most important headline</h1> <p>This is ordinary paragraph text within the body of the document, where certain words and phrases may be <em>emphasized</em> to mark them as <strong>particularly important</strong>.</p> <h2>This is a headline of secondary importance to the headline above</h2> <p>Any time you list related things, the items should be marked up in the form of a list:</p> <ul> <li>A list signals that a group of items are conceptually related to each other</li> <li>Lists may be ordered (numbered or alphabetic) or unordered (bulleted items)</li> <li>Lists may also be menus or lists of links for navigation </li> <li>Cascading Style Sheets can make lists look many different ways</li> </ul> Browsers, mobile devices, screen readers, search engines can not “see” the page… they extract meaning and context from the markup. The Site Development Process http://webstyleguide.com

Presentation handled by CSS CSS – Cascading Style Sheets A style-sheet language developed to control the presentation of HTML documents Allows for the separates the presentation (formatting) from the structure and content of the page. Structure = the content (headings, lists, paragraphs) Presentation = how the structure looks visually in the user agent (red, bold, verdana) CSS – used to format the presentation of the content fonts, colors, layout

Benefits of CSS Offers more control One CSS file can control thousands of pages (more efficient) More control over formatting Precise formatting: Line spacing, type sizes, rollovers, layout Modular design - same site content and structure can be style for different output devices Media types: Screen(browsers), mobile devices, print, screen reader Smaller files / Faster download No redundant formatting tags

Example of CSS Separate language with its own syntax Selectors: Selects the element to be affected Declaration: “declares” a style for a selected element Declaration block: property & value

Example of CSS Declaration block Selector – example Property: identifies what to change Value: how to change it Selector – example h1{ font-size: small; font-family: Georgia, ‘Times New Roman’, Times, serif; color: #CC3300; margin-top: 4em; margin-bottom: 10em; }

CSS for layout Examples http://www.shinybytes.com/newcss.html