SlideShare a Scribd company logo
1 of 19
CS 299 – Web Programming and Design
Introduction to HTML
CS 299 – Web Programming and Design 2
HTML: HyperText Markup Language
• HTML documents are simply text documents
with a specific form
– Documents comprised of content and markup tags
– Content: actual information being conveyed
– The markup tags tell the Web browser how to
display the page
– An HTML file must have an htm or html file
extension
– An HTML file can be created using a simple text
editor
CS 299 – Web Programming and Design 3
Our First Example
• If you are running Windows, start Notepad
• If you are on a Mac, start SimpleText
• If you telnet to csupomona.edu, use “pico”
• Type in the following:
• Open this file using a browser, and you will see…
<html>
<head>
<title>Title of page</title>
</head>
<body>
This is my first homepage. <b>This text is bold</b>
</body>
</html>
CS 299 – Web Programming and Design 4
HTML Tags
• HTML tags are used to mark-up HTML
elements
– Surrounded by angle brackets < and >
– HTML tags normally come in pairs, like <tagname>
(start tag) and </tagname> (end tag)
– The text between the start and end tags is the
element content
– Not case-sensitive
– Follow the latest web standards:
• Use lowercase tags
CS 299 – Web Programming and Design 5
Tag Attributes
• Tags can have attributes that provide
additional information to an HTML element
– Attributes always come in name/value pairs like:
name=“value”
– Attributes are always specified in the start tag
– Attribute values should always be enclosed in quotes.
Double quotes are most common.
– Also case-insensitive: however, lowercase is
recommended
– <tagname a1=“v1” a2=“v2”></tagname>
– For example, <table border=“0”> is a start tag that
defines a table that has no borders
CS 299 – Web Programming and Design 6
HTML Document Structure
• Entire document enclosed within <html> and
</html> tags
• Two subparts:
– Head
• Enclosed within <head> and </head>
• Within the head, more tags can be used to specify title
of the page, meta-information, etc.
– Body
• Enclosed within <body> and </body>
• Within the body, content is to be displayed
• Other tags can be embedded in the body
CS 299 – Web Programming and Design 7
We’ll Study…
• HTML Basics
(http://www.w3schools.com/html/html_intro.asp):
– HTML Elements
– HTML Headings
– HTML Paragraphs
– HTML Formatting
– HTML Styles
– HTML Images
– HTML Tables
– HTML Lists
– HTML Forms
– HTML Colors
CS 299 – Web Programming and Design 8
More Basic Examples
• Using basic tags:
http://www.csupomona.edu/~ftang/www/courses/CS299-
S09/examples/ex1.html
• Text formatting:
http://www.csupomona.edu/~ftang/www/courses/CS299-
S09/examples/ex2.html
• HTML links: http://www.csupomona.edu/~ftang/www/courses/CS299-
S09/examples/ex3.html
CS 299 – Web Programming and Design 9
HTML Layout
• One common way is to use HTML tables to format the
layout of an HTML page
– The trick is to use a table without borders, and maybe a
little extra cell-padding
• Other tips:
– Keep screen resolution in mind
– Use color to define spaces
– Align your images
– Balance the graphics and text on a page
– Think about text width – scan length 7 – 11 words
– Centering text is inadvisable
– Here is the link:
http://webdesign.about.com/od/layout/a/aa062104.htm
CS 299 – Web Programming and Design 10
HTML Frames
• HTML frames are a means of having several
browser windows open within a single larger
window
• Each HTML document is called a frame
• Disadvantages:
– Must keep track of more HTML documents
– Difficult to print the entire page
• Example of using frame
– http://www.csupomona.edu/~ftang/www/courses/CS299-S09/examples/frame.html
– http://www.w3schools.com/html/html_frames.asp
CS 299 – Web Programming and Design
HTML Advanced
CS 299 – Web Programming and Design 12
Topics Covered
• From HTML tutorial on w3schools.com
– HTML CSS
– HTML Entities
– HTML Head
– HTML Meta
– HTML URLs
– HTML Scripts
– HTML Attributes
– HTML Events
– HTML URL Encode
– HTML Webserver
CS 299 – Web Programming and Design 13
Script Examples
• Add scripts to HTML pages can make them
more dynamic and interactive
• Examples from W3schools
• Our simple example:
– http://www.csupomona.edu/~ftang/www/courses/CS299-S09/examples/jscript.html
CS 299 – Web Programming and Design 14
HTML and XHTML Full References
• Full Reference from W3schools:
– http://www.w3schools.com/tags/
• Test your HTML
– http://www.w3schools.com/html/html_whyusehtml4.asp
CS 299 – Web Programming and Design
XHTML
http://www.w3schools.com/xhtml/
CS 299 – Web Programming and Design 16
What is XHTML?
• XHTML is a stricter and cleaner version of
HTML
– EXtensible HyperText Markup Language
– aimed to replace HTML
– identical to HTML 4.01
– combination of HTML and XML (EXtensible Markup
Lanuage)
– W3C Recommendation
CS 299 – Web Programming and Design 17
Why XHTML?
• Many pages contain “bad” HTML
<html>
<head> <title>This is bad HTML</title>
<body> <h1>Bad HTML </body>
• XML is a markup language where everything has to be
marked up correctly, which results in “well-formed”
documents
• Different browser technologies require “good” markup
language
• XHTML combines the strengths of HTML and XML
CS 299 – Web Programming and Design 18
Most Important Differences From HTML
• XHTML elements must be properly nested
• XHTML elements must always be closed
• XHTML elements must be in lowercase
• XHTML documents must have one root
element
• Examples
– http://www.w3schools.com/xhtml/xhtml_html.asp
CS 299 – Web Programming and Design 19
XHTML Syntax
• More XHMTL Syntax Rules
– Attribute names must be in lower case
– Attribute values must be quoted
– Attribute minimization is forbidden
– The id attribute replaces the name attribute
– Mandatory elements
• Examples
– http://www.w3schools.com/xhtml/xhtml_syntax.asp
• Test your XHTML with the W3C Validator

More Related Content

Similar to html.ppt

Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to htmlpalhaftab
 
02 HTML-01.pdf
02 HTML-01.pdf02 HTML-01.pdf
02 HTML-01.pdfEshaYasir1
 
BITM3730Week1.pptx
BITM3730Week1.pptxBITM3730Week1.pptx
BITM3730Week1.pptxMattMarino13
 
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptxHTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptxTEJASARGADE5
 
1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptxMattMarino13
 
Introductions of the HTML Language .pptx
Introductions of the HTML Language .pptxIntroductions of the HTML Language .pptx
Introductions of the HTML Language .pptxlahelex741
 
HTML (Basic to Advance)
HTML (Basic to Advance)HTML (Basic to Advance)
HTML (Basic to Advance)Coder Tech
 
Web technologies-course 02.pptx
Web technologies-course 02.pptxWeb technologies-course 02.pptx
Web technologies-course 02.pptxStefan Oprea
 
HTML & CSS Training Institute in Ambala ! Batra Computer Centre
HTML & CSS Training Institute in Ambala ! Batra Computer CentreHTML & CSS Training Institute in Ambala ! Batra Computer Centre
HTML & CSS Training Institute in Ambala ! Batra Computer Centrejatin batra
 
Wt-UNNIT-1 (1).ppt
Wt-UNNIT-1 (1).pptWt-UNNIT-1 (1).ppt
Wt-UNNIT-1 (1).pptGReshma10
 
Origins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTMLOrigins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTMLHowpk
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTMLMarlon Jamera
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02Aditya Varma
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmleShikshak
 
SEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.inSEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.inSky Infotech
 

Similar to html.ppt (20)

Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
02 HTML-01.pdf
02 HTML-01.pdf02 HTML-01.pdf
02 HTML-01.pdf
 
BITM3730Week1.pptx
BITM3730Week1.pptxBITM3730Week1.pptx
BITM3730Week1.pptx
 
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptxHTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
 
1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx
 
Introductions of the HTML Language .pptx
Introductions of the HTML Language .pptxIntroductions of the HTML Language .pptx
Introductions of the HTML Language .pptx
 
HTML (Basic to Advance)
HTML (Basic to Advance)HTML (Basic to Advance)
HTML (Basic to Advance)
 
Web technologies-course 02.pptx
Web technologies-course 02.pptxWeb technologies-course 02.pptx
Web technologies-course 02.pptx
 
Html
HtmlHtml
Html
 
HTML & CSS Training Institute in Ambala ! Batra Computer Centre
HTML & CSS Training Institute in Ambala ! Batra Computer CentreHTML & CSS Training Institute in Ambala ! Batra Computer Centre
HTML & CSS Training Institute in Ambala ! Batra Computer Centre
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
Wt-UNNIT-1 (1).ppt
Wt-UNNIT-1 (1).pptWt-UNNIT-1 (1).ppt
Wt-UNNIT-1 (1).ppt
 
Origins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTMLOrigins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTML
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTML
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
SEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.inSEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.in
 
Basic html structure
Basic html structureBasic html structure
Basic html structure
 
Slides 2 - HTML
Slides 2 - HTMLSlides 2 - HTML
Slides 2 - HTML
 

More from Irfan Ahmed

IP chapter 2.1.pptx
IP chapter 2.1.pptxIP chapter 2.1.pptx
IP chapter 2.1.pptxIrfan Ahmed
 
GST-Intra State Supply of Goods.pptx
GST-Intra State Supply of Goods.pptxGST-Intra State Supply of Goods.pptx
GST-Intra State Supply of Goods.pptxIrfan Ahmed
 
AcademicsUserManual.pdf
AcademicsUserManual.pdfAcademicsUserManual.pdf
AcademicsUserManual.pdfIrfan Ahmed
 

More from Irfan Ahmed (9)

One_-ANOVA.ppt
One_-ANOVA.pptOne_-ANOVA.ppt
One_-ANOVA.ppt
 
Facebook.pptx
Facebook.pptxFacebook.pptx
Facebook.pptx
 
IP chapter 2.1.pptx
IP chapter 2.1.pptxIP chapter 2.1.pptx
IP chapter 2.1.pptx
 
GST-Intra State Supply of Goods.pptx
GST-Intra State Supply of Goods.pptxGST-Intra State Supply of Goods.pptx
GST-Intra State Supply of Goods.pptx
 
Facebook.pptx
Facebook.pptxFacebook.pptx
Facebook.pptx
 
AcademicsUserManual.pdf
AcademicsUserManual.pdfAcademicsUserManual.pdf
AcademicsUserManual.pdf
 
Bigbazar proj
Bigbazar projBigbazar proj
Bigbazar proj
 
Viru proj
Viru projViru proj
Viru proj
 
Viru project
Viru projectViru project
Viru project
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

html.ppt

  • 1. CS 299 – Web Programming and Design Introduction to HTML
  • 2. CS 299 – Web Programming and Design 2 HTML: HyperText Markup Language • HTML documents are simply text documents with a specific form – Documents comprised of content and markup tags – Content: actual information being conveyed – The markup tags tell the Web browser how to display the page – An HTML file must have an htm or html file extension – An HTML file can be created using a simple text editor
  • 3. CS 299 – Web Programming and Design 3 Our First Example • If you are running Windows, start Notepad • If you are on a Mac, start SimpleText • If you telnet to csupomona.edu, use “pico” • Type in the following: • Open this file using a browser, and you will see… <html> <head> <title>Title of page</title> </head> <body> This is my first homepage. <b>This text is bold</b> </body> </html>
  • 4. CS 299 – Web Programming and Design 4 HTML Tags • HTML tags are used to mark-up HTML elements – Surrounded by angle brackets < and > – HTML tags normally come in pairs, like <tagname> (start tag) and </tagname> (end tag) – The text between the start and end tags is the element content – Not case-sensitive – Follow the latest web standards: • Use lowercase tags
  • 5. CS 299 – Web Programming and Design 5 Tag Attributes • Tags can have attributes that provide additional information to an HTML element – Attributes always come in name/value pairs like: name=“value” – Attributes are always specified in the start tag – Attribute values should always be enclosed in quotes. Double quotes are most common. – Also case-insensitive: however, lowercase is recommended – <tagname a1=“v1” a2=“v2”></tagname> – For example, <table border=“0”> is a start tag that defines a table that has no borders
  • 6. CS 299 – Web Programming and Design 6 HTML Document Structure • Entire document enclosed within <html> and </html> tags • Two subparts: – Head • Enclosed within <head> and </head> • Within the head, more tags can be used to specify title of the page, meta-information, etc. – Body • Enclosed within <body> and </body> • Within the body, content is to be displayed • Other tags can be embedded in the body
  • 7. CS 299 – Web Programming and Design 7 We’ll Study… • HTML Basics (http://www.w3schools.com/html/html_intro.asp): – HTML Elements – HTML Headings – HTML Paragraphs – HTML Formatting – HTML Styles – HTML Images – HTML Tables – HTML Lists – HTML Forms – HTML Colors
  • 8. CS 299 – Web Programming and Design 8 More Basic Examples • Using basic tags: http://www.csupomona.edu/~ftang/www/courses/CS299- S09/examples/ex1.html • Text formatting: http://www.csupomona.edu/~ftang/www/courses/CS299- S09/examples/ex2.html • HTML links: http://www.csupomona.edu/~ftang/www/courses/CS299- S09/examples/ex3.html
  • 9. CS 299 – Web Programming and Design 9 HTML Layout • One common way is to use HTML tables to format the layout of an HTML page – The trick is to use a table without borders, and maybe a little extra cell-padding • Other tips: – Keep screen resolution in mind – Use color to define spaces – Align your images – Balance the graphics and text on a page – Think about text width – scan length 7 – 11 words – Centering text is inadvisable – Here is the link: http://webdesign.about.com/od/layout/a/aa062104.htm
  • 10. CS 299 – Web Programming and Design 10 HTML Frames • HTML frames are a means of having several browser windows open within a single larger window • Each HTML document is called a frame • Disadvantages: – Must keep track of more HTML documents – Difficult to print the entire page • Example of using frame – http://www.csupomona.edu/~ftang/www/courses/CS299-S09/examples/frame.html – http://www.w3schools.com/html/html_frames.asp
  • 11. CS 299 – Web Programming and Design HTML Advanced
  • 12. CS 299 – Web Programming and Design 12 Topics Covered • From HTML tutorial on w3schools.com – HTML CSS – HTML Entities – HTML Head – HTML Meta – HTML URLs – HTML Scripts – HTML Attributes – HTML Events – HTML URL Encode – HTML Webserver
  • 13. CS 299 – Web Programming and Design 13 Script Examples • Add scripts to HTML pages can make them more dynamic and interactive • Examples from W3schools • Our simple example: – http://www.csupomona.edu/~ftang/www/courses/CS299-S09/examples/jscript.html
  • 14. CS 299 – Web Programming and Design 14 HTML and XHTML Full References • Full Reference from W3schools: – http://www.w3schools.com/tags/ • Test your HTML – http://www.w3schools.com/html/html_whyusehtml4.asp
  • 15. CS 299 – Web Programming and Design XHTML http://www.w3schools.com/xhtml/
  • 16. CS 299 – Web Programming and Design 16 What is XHTML? • XHTML is a stricter and cleaner version of HTML – EXtensible HyperText Markup Language – aimed to replace HTML – identical to HTML 4.01 – combination of HTML and XML (EXtensible Markup Lanuage) – W3C Recommendation
  • 17. CS 299 – Web Programming and Design 17 Why XHTML? • Many pages contain “bad” HTML <html> <head> <title>This is bad HTML</title> <body> <h1>Bad HTML </body> • XML is a markup language where everything has to be marked up correctly, which results in “well-formed” documents • Different browser technologies require “good” markup language • XHTML combines the strengths of HTML and XML
  • 18. CS 299 – Web Programming and Design 18 Most Important Differences From HTML • XHTML elements must be properly nested • XHTML elements must always be closed • XHTML elements must be in lowercase • XHTML documents must have one root element • Examples – http://www.w3schools.com/xhtml/xhtml_html.asp
  • 19. CS 299 – Web Programming and Design 19 XHTML Syntax • More XHMTL Syntax Rules – Attribute names must be in lower case – Attribute values must be quoted – Attribute minimization is forbidden – The id attribute replaces the name attribute – Mandatory elements • Examples – http://www.w3schools.com/xhtml/xhtml_syntax.asp • Test your XHTML with the W3C Validator