SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
HyperText Markup
Language (HTML)
Mendel Rosenblum
1
CS142 Lecture Notes - HTML
Web Application Architecture
Web Browser
Web Server /
Application server
HTTP
Storage System
Internet
LAN
2
CS142 Lecture Notes - HTML
Browser environment is different
Traditional app: GUIs based on pixels
Since 1970s: software accessed mapped framebuffers (R/G/B)
Toolkits build higher level GUI widgets (buttons, tables, etc.)
Web browsers display Documents described in HTML
Until HTML5’s canvas region, you couldn’t write pixels
Make applications out of documents
Early web apps: Multiple documents (pages) with ‘form’ tag for input
Current: Use JavaScript to dynamically generate and update documents
3
CS142 Lecture Notes - HTML
HTML: HyperText Markup Language
Concept: Markup Language - Include directives with content
Directives can dictate presentation or describe content
Idea from the 1960s: RUNOFF
Examples: <i>italics word</i>, <title>Title words</title>
Example of a declarative language
Approach
1. Start with content to be displayed
2. Annotate it with tags
HTML uses < > to denote tags
4
CS142 Lecture Notes - HTML
HTML tags
Tags can provide:
Meaning of text:
● <h1> means top-level heading
● <p> means paragraph
● <ul><li> for unordered (bulleted) list
Formatting information (<i> for italic)
Additional information to display (e.g., <img>)
Tags can have tags inside (nesting supported) - Document forms a tree
5
CS142 Lecture Notes - HTML
Example of HTML - Start with raw content text
Introduction
There are several good reasons for taking
CS142: Web Applications:
You will learn a variety of interesting concepts.
It may inspire you to change the way software is developed.
It will give you the tools to become fabulously wealthy.
6
CS142 Lecture Notes - HTML
Example of HTML - Annotate with tags
<h2>Introduction</h2>
<p>
There are several good reasons for taking
<i>CS142: Web Applications</i>:
</p>
<ul>
<li>
You will learn a variety of interesting concepts.
</li>
<li>
It may inspire you to change the way software is developed.
</li>
<li>
It will give you the tools to become fabulously wealthy.
</li>
</ul>
7
CS142 Lecture Notes - HTML
Browser doesn’t care but programmers do
<h2>Introduction</h2>
<p>
There are several good reasons for taking
<i>CS142: Web Applications</i>:
</p>
<ul>
<li>
You will learn a variety of interesting concepts.
</li>
<li>
It may inspire you to change the way software is developed.
</li>
<li>
It will give you the tools to become fabulously wealthy.
</li>
</ul>
8
CS142 Lecture Notes - HTML
Example HTML - Browser output
Introduction
There are several good reasons for taking CS142: Web Applications:
● You will learn a variety of interesting concepts.
● It may inspire you to change the way software is developed.
● It will give you the tools to become fabulously wealthy.
9
CS142 Lecture Notes - HTML
HTML Evolution
Influenced by browser implementation quirks
What to do if you see “<p>Some text” (missing closing </p>)?
1. Complain bitterly about malformed HTML.
2. Figure out there was a missing </p>, add it, and continue processing.
Forked into HTML and XHTML (XML-based HTML)
XHTML is more strict about adhering to proper syntax
For the HTML class projects (1, 2, and 3) we will use XHTML
Users came to depend on browser quirks, so browsers couldn't change
10
CS142 Lecture Notes - HTML
Example XHTML document
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Hello World</title>
</head>
<body>
<p>Hello world!</p>
</body>
</html>
11
CS142 Lecture Notes - HTML
Basic Syntax rules for XHTML
Document: hierarchical collection of elements, starting with <html>
Element: start tag, contents, end tag
Elements may be nested
Every element must have an explicit start and end
Can use <foo /> as shorthand for <foo></foo>
Start tags can contain attributes:
<img src="face.jpg">
<input type="text" value="94301" name="zip">
<div class="header">
12
CS142 Lecture Notes - HTML
Need to handle markup characters in content
To display a literal < or > in a document, use entities:
&lt; Displays <
&gt; Displays >
&amp; Displays &
&quot; Displays "
&nbsp; Nonbreaking space (won’t insert a line break at this space)
Many other entities are defined for special characters.
Whitespace is not significant except in a few cases (e.g. textarea, pre tags)
13
CS142 Lecture Notes - HTML
Example XHTML document structure
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Hello World</title>
</head>
<body>
<p>Hello world!</p>
</body>
</html>
14
CS142 Lecture Notes - HTML
XHTML document structure
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Indicate that this is an XHTML document, conforming to version 1.0 of the
standard; use these lines verbatim in all the web pages you create for this
class.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Outermost element containing the document
<head>: Contains miscellaneous things such as page title, CSS stylesheets, etc.
<body>: the main body of the document
15
CS142 Lecture Notes - HTML
Common usage XHTML tags
<p> New paragraph
<br> Force a line break within the same paragraph
<h1>, <h2>, ... Headings
<b>, <i> Boldface and italic
<pre> Typically used for code: indented with a fixed-width font,
spaces are significant (e.g., newlines are preserved)
<img> Images
<a href="..."> Hyperlink to another Web page
<!-- comments --> Comment tags
16
CS142 Lecture Notes - HTML
Common used XHTML tags - continued
<table>, <tr>, <td> Tables
<ul>, <li> Unordered list (with bullets)
<ol>, <li> Ordered list (numbered)
<div> Used for grouping related elements, where the group
occupies entire lines (forces a line break before and after)
<span> Used for grouping related elements, where the group is
within a single line (no forced line breaks)
<form>, <input>, <textarea>, <select>, ... Used to create forms where
users can input data
17
CS142 Lecture Notes - HTML
Commonly used tags: <head> section
<title> Specify a title for the page, which will appear in the title bar
for the browser window.
<link> Include CSS stylesheets
<script> Used to add Javascript to a page (can be used in body as well)
18
CS142 Lecture Notes - HTML
HTML differences from XHTML
HTML supports the same tags, same features, but allows quirkier syntax:
Can skip some end tags, such as </br>, </p>
Not all attributes have to have values: <select multiple>
Elements can overlap: <p><b>first</p><p>second</b> third</p>
Early browsers tried to "do the right thing" even in the face of incorrect HTML:
Ignore unknown tags
Carry on even with obvious syntax errors such as missing <body> or </html>
Infer the position of missing close tags
Guess that some < characters are literal, as in "What if x < 0?"
Not obvious how to interpret some documents (and browsers differed)
19
CS142 Lecture Notes - HTML
Newer HTML - HTML5
● Additions tags to allow content definition
○ <article>, <section>, <header>, <footer>, <summary>, <aside>, <details>
○ <mark>, <figcaption>, <figure>
○ <nav>, <menuitem>
● Drawing
○ <svg> - Scalable Vector Graphics - Draw shapes
○ <canvas> - Draw from JavaScript - 3D with WebGL
● Timed media playback: <video> and <audio>
20
CS142 Lecture Notes - HTML
Another markup language: Markdown
# Heading
## Sub-heading
### Another deeper heading
Paragraphs are separated
by a blank line.
Two spaces at the end of a line leave a
line break.
Text attributes _italic_, *italic*, __bold__, **bold**,
`monospace`.
Horizontal rule:
--- 21
CS142 Lecture Notes - HTML
Bullet list:
* apples
* oranges
* pears
Numbered list:
1. apples
2. oranges
3. pears
A [link](http://example.com).
Example from https://en.wikipedia.org/wiki/Markdown
Markdown language example output
Heading
Sub-heading
Another deeper heading
Paragraphs are separated by a blank line.
Two spaces at the end of a line leave a
line break.
Text attributes italic, italic, bold, bold, monospace.
Horizontal rule:
22
CS142 Lecture Notes - HTML
Bullet list:
● apples
● oranges
● pears
Numbered list:
1. apples
2. oranges
3. pears
A link.

Weitere ähnliche Inhalte

Ähnlich wie HTML.pdf

1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development1 Introduction to Drupal Web Development
1 Introduction to Drupal Web DevelopmentWingston
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you needDipen Parmar
 
Web Development Course - HTML5 & CSS3 by RSOLUTIONS
Web Development Course - HTML5 & CSS3 by RSOLUTIONSWeb Development Course - HTML5 & CSS3 by RSOLUTIONS
Web Development Course - HTML5 & CSS3 by RSOLUTIONSRSolutions
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.Beqa Chacha
 
Additional HTML
Additional HTML Additional HTML
Additional HTML Doeun KOCH
 
1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt1. Introduction to HTML5.ppt
1. Introduction to HTML5.pptJyothiAmpally
 
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTESSony235240
 
1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentationJohnLagman3
 
Introduction to html55
Introduction to html55Introduction to html55
Introduction to html55subrat55
 
wd project.pptx
wd project.pptxwd project.pptx
wd project.pptxdsffsdf1
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSTimo Herttua
 
Essential html tweaks for accessible themes
Essential html tweaks for accessible themesEssential html tweaks for accessible themes
Essential html tweaks for accessible themesMartin Stehle
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5Manav Prasad
 
Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Paxcel Technologies
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5IT Geeks
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxAliRaza899305
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxKADAMBARIPUROHIT
 

Ähnlich wie HTML.pdf (20)

1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
 
Web Development Course - HTML5 & CSS3 by RSOLUTIONS
Web Development Course - HTML5 & CSS3 by RSOLUTIONSWeb Development Course - HTML5 & CSS3 by RSOLUTIONS
Web Development Course - HTML5 & CSS3 by RSOLUTIONS
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.
 
Additional HTML
Additional HTML Additional HTML
Additional HTML
 
1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt
 
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES
 
1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation
 
Html basics
Html basicsHtml basics
Html basics
 
Introduction to html55
Introduction to html55Introduction to html55
Introduction to html55
 
wd project.pptx
wd project.pptxwd project.pptx
wd project.pptx
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
 
Essential html tweaks for accessible themes
Essential html tweaks for accessible themesEssential html tweaks for accessible themes
Essential html tweaks for accessible themes
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1
 
HTML practical file
HTML practical fileHTML practical file
HTML practical file
 
Before start
Before startBefore start
Before start
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
 

Mehr von stephanedjeukam1 (11)

HTTP.pdf
HTTP.pdfHTTP.pdf
HTTP.pdf
 
Database.pdf
Database.pdfDatabase.pdf
Database.pdf
 
CodeInjection.pdf
CodeInjection.pdfCodeInjection.pdf
CodeInjection.pdf
 
Express.pdf
Express.pdfExpress.pdf
Express.pdf
 
Input.pdf
Input.pdfInput.pdf
Input.pdf
 
FrontEnd.pdf
FrontEnd.pdfFrontEnd.pdf
FrontEnd.pdf
 
DOM.pdf
DOM.pdfDOM.pdf
DOM.pdf
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
DOSAttacks.pdf
DOSAttacks.pdfDOSAttacks.pdf
DOSAttacks.pdf
 
0000 Syllabus.pdf
0000  Syllabus.pdf0000  Syllabus.pdf
0000 Syllabus.pdf
 
Events.pdf
Events.pdfEvents.pdf
Events.pdf
 

Kürzlich hochgeladen

Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolinonuriaiuzzolino1
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.krishnachandrapal52
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptxAsmae Rabhi
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsMonica Sydney
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxgalaxypingy
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样ayvbos
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Roommeghakumariji156
 

Kürzlich hochgeladen (20)

Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 

HTML.pdf

  • 1. HyperText Markup Language (HTML) Mendel Rosenblum 1 CS142 Lecture Notes - HTML
  • 2. Web Application Architecture Web Browser Web Server / Application server HTTP Storage System Internet LAN 2 CS142 Lecture Notes - HTML
  • 3. Browser environment is different Traditional app: GUIs based on pixels Since 1970s: software accessed mapped framebuffers (R/G/B) Toolkits build higher level GUI widgets (buttons, tables, etc.) Web browsers display Documents described in HTML Until HTML5’s canvas region, you couldn’t write pixels Make applications out of documents Early web apps: Multiple documents (pages) with ‘form’ tag for input Current: Use JavaScript to dynamically generate and update documents 3 CS142 Lecture Notes - HTML
  • 4. HTML: HyperText Markup Language Concept: Markup Language - Include directives with content Directives can dictate presentation or describe content Idea from the 1960s: RUNOFF Examples: <i>italics word</i>, <title>Title words</title> Example of a declarative language Approach 1. Start with content to be displayed 2. Annotate it with tags HTML uses < > to denote tags 4 CS142 Lecture Notes - HTML
  • 5. HTML tags Tags can provide: Meaning of text: ● <h1> means top-level heading ● <p> means paragraph ● <ul><li> for unordered (bulleted) list Formatting information (<i> for italic) Additional information to display (e.g., <img>) Tags can have tags inside (nesting supported) - Document forms a tree 5 CS142 Lecture Notes - HTML
  • 6. Example of HTML - Start with raw content text Introduction There are several good reasons for taking CS142: Web Applications: You will learn a variety of interesting concepts. It may inspire you to change the way software is developed. It will give you the tools to become fabulously wealthy. 6 CS142 Lecture Notes - HTML
  • 7. Example of HTML - Annotate with tags <h2>Introduction</h2> <p> There are several good reasons for taking <i>CS142: Web Applications</i>: </p> <ul> <li> You will learn a variety of interesting concepts. </li> <li> It may inspire you to change the way software is developed. </li> <li> It will give you the tools to become fabulously wealthy. </li> </ul> 7 CS142 Lecture Notes - HTML
  • 8. Browser doesn’t care but programmers do <h2>Introduction</h2> <p> There are several good reasons for taking <i>CS142: Web Applications</i>: </p> <ul> <li> You will learn a variety of interesting concepts. </li> <li> It may inspire you to change the way software is developed. </li> <li> It will give you the tools to become fabulously wealthy. </li> </ul> 8 CS142 Lecture Notes - HTML
  • 9. Example HTML - Browser output Introduction There are several good reasons for taking CS142: Web Applications: ● You will learn a variety of interesting concepts. ● It may inspire you to change the way software is developed. ● It will give you the tools to become fabulously wealthy. 9 CS142 Lecture Notes - HTML
  • 10. HTML Evolution Influenced by browser implementation quirks What to do if you see “<p>Some text” (missing closing </p>)? 1. Complain bitterly about malformed HTML. 2. Figure out there was a missing </p>, add it, and continue processing. Forked into HTML and XHTML (XML-based HTML) XHTML is more strict about adhering to proper syntax For the HTML class projects (1, 2, and 3) we will use XHTML Users came to depend on browser quirks, so browsers couldn't change 10 CS142 Lecture Notes - HTML
  • 11. Example XHTML document <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Hello World</title> </head> <body> <p>Hello world!</p> </body> </html> 11 CS142 Lecture Notes - HTML
  • 12. Basic Syntax rules for XHTML Document: hierarchical collection of elements, starting with <html> Element: start tag, contents, end tag Elements may be nested Every element must have an explicit start and end Can use <foo /> as shorthand for <foo></foo> Start tags can contain attributes: <img src="face.jpg"> <input type="text" value="94301" name="zip"> <div class="header"> 12 CS142 Lecture Notes - HTML
  • 13. Need to handle markup characters in content To display a literal < or > in a document, use entities: &lt; Displays < &gt; Displays > &amp; Displays & &quot; Displays " &nbsp; Nonbreaking space (won’t insert a line break at this space) Many other entities are defined for special characters. Whitespace is not significant except in a few cases (e.g. textarea, pre tags) 13 CS142 Lecture Notes - HTML
  • 14. Example XHTML document structure <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Hello World</title> </head> <body> <p>Hello world!</p> </body> </html> 14 CS142 Lecture Notes - HTML
  • 15. XHTML document structure <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Indicate that this is an XHTML document, conforming to version 1.0 of the standard; use these lines verbatim in all the web pages you create for this class. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> Outermost element containing the document <head>: Contains miscellaneous things such as page title, CSS stylesheets, etc. <body>: the main body of the document 15 CS142 Lecture Notes - HTML
  • 16. Common usage XHTML tags <p> New paragraph <br> Force a line break within the same paragraph <h1>, <h2>, ... Headings <b>, <i> Boldface and italic <pre> Typically used for code: indented with a fixed-width font, spaces are significant (e.g., newlines are preserved) <img> Images <a href="..."> Hyperlink to another Web page <!-- comments --> Comment tags 16 CS142 Lecture Notes - HTML
  • 17. Common used XHTML tags - continued <table>, <tr>, <td> Tables <ul>, <li> Unordered list (with bullets) <ol>, <li> Ordered list (numbered) <div> Used for grouping related elements, where the group occupies entire lines (forces a line break before and after) <span> Used for grouping related elements, where the group is within a single line (no forced line breaks) <form>, <input>, <textarea>, <select>, ... Used to create forms where users can input data 17 CS142 Lecture Notes - HTML
  • 18. Commonly used tags: <head> section <title> Specify a title for the page, which will appear in the title bar for the browser window. <link> Include CSS stylesheets <script> Used to add Javascript to a page (can be used in body as well) 18 CS142 Lecture Notes - HTML
  • 19. HTML differences from XHTML HTML supports the same tags, same features, but allows quirkier syntax: Can skip some end tags, such as </br>, </p> Not all attributes have to have values: <select multiple> Elements can overlap: <p><b>first</p><p>second</b> third</p> Early browsers tried to "do the right thing" even in the face of incorrect HTML: Ignore unknown tags Carry on even with obvious syntax errors such as missing <body> or </html> Infer the position of missing close tags Guess that some < characters are literal, as in "What if x < 0?" Not obvious how to interpret some documents (and browsers differed) 19 CS142 Lecture Notes - HTML
  • 20. Newer HTML - HTML5 ● Additions tags to allow content definition ○ <article>, <section>, <header>, <footer>, <summary>, <aside>, <details> ○ <mark>, <figcaption>, <figure> ○ <nav>, <menuitem> ● Drawing ○ <svg> - Scalable Vector Graphics - Draw shapes ○ <canvas> - Draw from JavaScript - 3D with WebGL ● Timed media playback: <video> and <audio> 20 CS142 Lecture Notes - HTML
  • 21. Another markup language: Markdown # Heading ## Sub-heading ### Another deeper heading Paragraphs are separated by a blank line. Two spaces at the end of a line leave a line break. Text attributes _italic_, *italic*, __bold__, **bold**, `monospace`. Horizontal rule: --- 21 CS142 Lecture Notes - HTML Bullet list: * apples * oranges * pears Numbered list: 1. apples 2. oranges 3. pears A [link](http://example.com). Example from https://en.wikipedia.org/wiki/Markdown
  • 22. Markdown language example output Heading Sub-heading Another deeper heading Paragraphs are separated by a blank line. Two spaces at the end of a line leave a line break. Text attributes italic, italic, bold, bold, monospace. Horizontal rule: 22 CS142 Lecture Notes - HTML Bullet list: ● apples ● oranges ● pears Numbered list: 1. apples 2. oranges 3. pears A link.