Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML – Introduction to the Code

Similar presentations


Presentation on theme: "HTML – Introduction to the Code"— Presentation transcript:

1 HTML – Introduction to the Code

2 How the Web Works Clients / Server
WWW – part of the Internet (others: , FTP, Telnet) HTML/XHTML Docs Loaded to a Server | Viewed in a Browser (Client) Client: Request & Render Content Browsers, mobile devices, screen readers Servers: Applications that deliver web content or services FTP, mail servers, DB servers, name servers, application servers Clients / Server

3 WWW / Web docs - Based on HTTP | HYPERTEXT | HTML
WWW / Web docs - Based on HTTP | HYPERTEXT | HTML HTTP: Hypertext Transfer Protocol The protocol or rules that specify how information is requested and sent between web server and client (Protocol: Standardized format for transferring data between devices – Others: FTP, SMTP (Simple Mail Transfer Protocol), POP (Post Office Protocol)) HTTP Client HTTP Server

4 URL – Uniform Resource Locator
Protocol: Tells the browser that its using Hypertext Transfer Protocol Domain Name: Indicates the server that the browser should connect to Pathname Filename

5 Folder Structure & Path Names
Another Example: Browser will find the SOIS server (domain): Open the folder called: academics Find and open the folder called: graduate And retrieve and display the file called: mlis.html

6

7 HTML: Hypertext Markup Language Simple, universal mark-up language used to publish content on the web Standard mark-up language for web pages WEB PAGE Uses HTML tags Describes a documents structure A plain text document (no specific software needed) Saved with .htm or .html extension Hosted on a server

8 HTML <!DOCTYPE html> <html> <head>
<meta charset="utf-8"> <title>Untitled Document</title> </head> <body> This is where the content of your page will be placed. </body> </html>

9 HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " <html xmlns=" <head> <meta http-equiv="Content-Type" content="text/html; charset=iso " /> <title>A Brief Look At Changing Web Standards</title> <link href="newstyle.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="print.css" media="print"/> </head> <body> <div id="logo"> <h1>A Brief Look At Changing Web Standards</h1> </div> <div id="header"></div> <div id="page"> <div id="navigation"> <p><a href="newindex.html">Current Trends</a><a href="newstandards.html">Web Standards</a> <a href="newquotes.html">Semantic Markup</a> <a href="newcss.html">CSS</a><a href="newresources.html">Resources</a></p> <p> </p> <p> </p> <p> </p> </div> <div id="contents"> <h1>Benefits of CSS</h1> <p>CSS allows us to separate the structure and content of our sites from the presentation of the site. There are many Benefits to this. </p> <h2>CSS - Separating Content From Presentation</h2> <ul> <li><a href="css.html">NEW STYLE</a> | <a href="default.css">view style sheet</a> |</li> <li><a href="nostyle.html">NO STYLES</a></li> <li><a href="newexamples.html">EXAMPLES</a></li> <li>CURRENT STYLE | <a href="newstyle.css">view style sheet</a> |</li> </ul> <h2>CSS - Accessibility and Alternative Devices</h2> <p>Media Types:all, braille, embossed, handheld, <strong>print</strong>, projection, screen, speech, tv<br /> <br /> </p> <p><em>This site was created to demonstrate some of the benefits of writng standards compliant code, using semantic markup and implementing CSS to separate presentation for content. For a complete list of useful resources, please visit the resources page of this site. For questions, comments or suggestions, </em>Rebecca Hall: [ <a ]<br /> <br /> </p> </div> </div> </div> <div id="footer"></div> <div id="notes">Copyright © 2008 Last updated: June, 2008 <br /> Send Comments to <a </table> <p align="center"><font color="#FFFFFF" size="2"><font color="#000000">| <a href="../../about/index.html">About SOIS</a> | <a href="../index.htm">Academic Programs</a> | <a href="../../admission/index.html">Admission</a> | <a href="../../alumni/index.html">Alumni</a> | <a href=" target="_blank">DE Access</a> | <a href="../../about/news/index.htm">News</a> | <a href=" | <a href=" | <a href=" | <a href="../../resources/index.html">Student Resources</a> |<br> | <a Us</a> | <a href="../../directory/index.html">Directory</a> | <a href="../../search/index.htm">Search</a> | <a href="../../sitemap/index.htm">Site Map</a> | <a href=" Intranet</a> |</font></font></p> <div align="center"><span class="news style1"><font face="Verdana, Arial, Helvetica, sans-serif"><em><font face="Verdana, Arial, Helvetica, sans-serif"><strong>©2009 </strong></font> University of Wisconsin-Milwaukee, School of Information Studies<br> <font color="#FFFFFF">Please mail any comments or suggestions to <a This page last updated on 02/09</font><font color="#FFFFFF"></font></em></font></span><br> </div></td> </tr> </table> <map name="Map"> <area shape="rect" coords="128,9,286,58" href=" alt="Link to UWM"> </map> </body> </html>

10 HTML Structure

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

12 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 ( / )

13 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 />)

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

15 HTML Basic HTML Structure – 3 parts 1) <html>…</html>
First and last tag in a document 2) <head>…</head> Includes info about your document Non visual elements (metatags, links to external resources, scripts or internal resources) <title>…</title> Name of page (bookmarks, browser indexing) 3) <body>…</body> Contains visual & structural elements (visible on page)

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

17 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 ( Oversees ongoing development of the web Keeps track of browser features Help develop guidelines for common HTML language (HTML ) (versions:

18 HTML Versions HTML 2.0 - specification released in 1995
HTML tags - informal CERN document listing 12 tags (1991) HTML specification released in 1995 HTML first version developed and standardized exclusively by the W3C (1996) HTML published as W3C recommendation (1997) HTML published as W3C recommendation (1999) XHTML published as W3C recommendation (2000) More structure less presentation (XML based approach) XHTML published as W3C recommendation (2001) XHTML NO STANDARD ( ) 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)

19 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:

20 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

21 XHTML what does it look like?
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” <html xmlns=“ <head> <title>Untitled Document</title> </head> <body> This is where the content of your page will be placed. </body> </html>

22 XHTML what does it look like?
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” DOCUMENT TYPE DEFINITION (DTD): Defines all elements and attributes in the language & their rules (defines which flavor of html you are using) a file that outlines the available structure, elements, attributes, and their appropriate usage (URL to this DTD – machine readable file)

23 XHTML what does it look like?
DOCUMENT TYPE DEFINITION – 3 (most common) XHTML DTDs XHTML Transitional: maintains backward compatibility with older browsers while still allowing access to HTML 4.01 elements. (includes presentation elements that were in common use) XHTML Strict: doesn’t allow any HTML elements that were designed to control the appearance of a page. (omits all deprecated elements) XHTML Frameset: allows HTML elements needed to create framesets. Great explanation can be found at: Child, D. (2004) DTDs Explained, Added Bytes Available:

24 XHTML what does it look like?
<html xmlns= 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.

25 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

26 HTML Versions HTML 2.0 - specification released in 1995
HTML tags - informal CERN document listing 12 tags (1991) HTML specification released in 1995 HTML first version developed and standardized exclusively by the W3C (1996) HTML published as W3C recommendation (1997) HTML published as W3C recommendation (1999) XHTML published as W3C recommendation (2000) More structure less presentation (XML based approach) XHTML published as W3C recommendation (2001) XHTML NO STANDARD ( ) 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)

27 HTML Versions Is HTML 5 Ready Yet?

28 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 : | | |

29 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

30 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 Inline Elements Ex: <em>…</em> Flow within other elements (do not start new line)

31 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 />

32 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

33 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> bold, <center>, <i> italics (please use: <strong> & <em> instead)

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

35 HTML Images img tag <img> Required attribute: src
<img src=“uwm_logo.gif” alt=“UWM Logo” />

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

37 HTML Links The anchor <a>…</a> Required attribute: href
<a href= Link to UWM </a> <a href= src=“uwm_logo.gif”/>UWM</a>

38 Site Directory and File Structure
Often mirrors visible site structure Logical naming conventions – plain language Creates useful/understandable URLs

39 6,100 Files 250 Folders

40 Hypertext – Absolute & Relative Links
Absolute Links <a href=“ 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)

41 <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>

42 <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>

43 <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>

44 Index?? Significance of “index”
Usually the default filename a browser will look for if no filename is provide. retrieving a file called “index.html” in the Spring_2012 folder

45 <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>

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

47 Back to the Code <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” <html xmlns=“ <head> <title>Untitled Document</title> </head> <body> This is where the content of your page will be placed. </body> </html>

48 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.

49 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

50 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

51 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: Screeen(browsers), mobile devices, print, screen reader Smaller files / Faster download No redundant formatting tags

52 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

53 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; }

54 CSS for layout Examples


Download ppt "HTML – Introduction to the Code"

Similar presentations


Ads by Google