SlideShare une entreprise Scribd logo
1  sur  26
Introduction to Web Programming (X)HTML
Plan of the course XHTML and HTML  Structure of a document Main HTML Tags Headings Paragraphs Links Tables Forms Images
HTML HTML – HyperText Markup Language It’s a markup language – uses tags to describe web pages Currently used version – 4.01 - http://www.w3.org/TR/html401/  - from 1999!! HTML 5 – work in progress XHTML - http://www.w3.org/TR/xhtml1/  - same tags but using some XML constraints XML – extension markup language – generic language for structuring documents
What is a html tag Keywords between “<“ and “>” There is usually a start tag and an end tag example: <tag>…</tag> Empty tags <tag /> Attributes An attribute is a pair of type name=“value” that is inside a tag <tag attribute=“value”> … </tag>
Characteristics of tags Tags should  always be closed “/>” be written in lowercase Be properly nested <tag1><tag2></tag2></tag1> <tag1><tag2></tag1></tag2>
HTML and XHTML Browser work on “best effort” when interpreting an HTML file => one of the reasons pages look different in different browsers Because browsers try to interpret everything they have become heavy and slow. XHTML – a more strict syntax than HTML=>easier to parse  by browsers
Structure of a document Logical structure of a document Title of the document  Titles of the different sections Content  Paragraphs, quoted text, code Tabular information Lists of items (ordered or unordered) Very short example of document structure using Word
Structure of an XHTML Document <html> 	<head> 		<title>the title of the document</title> 	</head> 	<body> 	<!-- the content of the document --> 	</body> </html>
The head section Contains data about the document <title> - the actual document title – appears in the browser bar <link> - points to a resource used by the page (<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />) <meta> - defines meta information like keywords, content type, description – used by browsers and by spiders <script> - contains references to scripts
Head Section Example <head>  <title>W3Schools Online Web Tutorials</title> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />  <meta name="Keywords" content="XML,tutorial,HTML,DHTML,CSS,XSL,XHTML,JavaScript,ASP,ADO,VBScript,DOM, " />  <meta name="Description" content="HTML XHTML CSS JavaScript XML XSL ASP SQL ADO VBScript Tutorials References Examples" />  <link rel="stylesheet" type="text/css" href="stdtheme.css" />  </head>
The body section Contains the tags that are displayed in the browser The body section SHOULD contain the content The style information should be placed in external documents (see next course) Elements are going to be presented next and we’re going to build a web page adding each element step by step
Headings The titles of the sections H1…H6 Used by search engines to “understand” the structure of the document SHOULD NOT be used for style reasons (make text bigger and bolder) <h1>title of document</h1> <h2> title of first section</h2> <h3> title of the first sub-section</h3>
Content and formatting <p>this is a paragraph</p> <br/> - passes to the next line <hr> - horizontal line <em> - emphasized text <strong> - strong text <small> - small text <sub> <sup>
Lists Ordered lists (numbered, ordered with letters or roman numbers) - <ol> Unordered lists (bulleted) – <ul> Items of the list for each of the 2 types of lists - <li> Example: <ul> <li>red</li> <li>green</li> </ul>
Links <a href=“absolute or relative url” target=“”>text or image</a> The target represents where the link should open Missing – the same page “_blank” – new window <a name=“name of an anchor in the same document> text or image </a> <a href=“#name of an anchor”>text or image</a>
Images <img src=“absolute or relative url” alt=“alternative text in case the image can’t be displayed or can’t be understood”/> The “alt” attribute is mandatory in XHTML!  the src can be a full url: http://host/path_to_file or a path relative to the current page.
Tables Tables should ONLY be used for presenting tabular information They should not be used for design <table> <tr> <!--table row) --> <td > table cell</td> </tr> </table>
Tables colspan used to have a cell that spans on multiple columns  Attribute of the td element rowspan used to have a cell span on multiple rows Attribute of the td element Border  If the table has a border or not Attribute of the table element
Tables example <table border="1"> 	<tr> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 	</tr> 	<tr> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 	</tr> 	<tr> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 	</tr> 	</table> <table border="1"> 	<tr> 		<td colspan="2">&nbsp;</td> <!-- only 3 cells because 1 spans on 2 columns--> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 	</tr> 	<tr> 		<td rowspan="2">&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 	</tr> 	<tr> 	<!-- only 3 cells because 1 above spans on 2 rows  --> 	<td>&nbsp;</td> 		<td>&nbsp;</td> 		<td>&nbsp;</td> 	</tr> 	</table>
Forms Necessary to collect and submit data to the server <form action=“the server script that handles the submitted data” method=“the HTTP request method – GET or POST”> A form contains different kinds of input
Form Inputs Text input <input type=“text” name=“” /> Checkbox <input type=“checkbox” name=“” value=“”/> Radio <input type=“radio” name=“” value=“”/> Text area <textarea name=“”></textarea> Submit <input type=“submit” value=“name on the button”/>
Form example <form method="post" action="script.php"> 	Username: <input type="text" name="username" /><br /> 	Password:<input type="password" name="password" /><br /> 	Country:  	<select name="country"> 		<option value="eng">England</option> 		<option value="fra">France</option> 		<option value="rou" selected="selected">Romania</option> 	</select> <br /> 	Address: <textarea name="address"></textarea><br /> 	Type of account: 		<ul><li>Normal <input type="radio" name="account" value="normal" /></li> 		<li>Special <input type="radio" name="account" value="special" /></li> 		</ul> 	Do you want to subscribe to our newsletter <input type="checkbox" name="subscription"/><br /> 	<input type="submit" value="Register" /> 	</form>
Others Html comments Whenever you write code you need to write comments <!--  this is a comment in html -->
HTML Special Characters Some special characters <,>,’ ‘,& need to be represented differently in HTML There shouldn’t be confusion between the content of the page and the syntax The special characters are represented like:&code; Code is usually a 3-4 letter sequence that represents the special character
HTML Special Characters & - &amp; ‘ ‘ (space) - &nbsp; “ - &quot; < - &lt; > - &gt; Others: http://www.w3schools.com/tags/ref_entities.asp http://www.w3schools.com/tags/ref_symbols.asp
Conclusions In this course there are only the most important tags; more of them can be discovered as you work  HTML should be used for presenting content in web pages The tags should be used according to their semantics

Contenu connexe

Tendances

(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS Dave Kelly
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/jsKnoldus Inc.
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML BasicsShawn Calvert
 
HTML Foundations, pt 2
HTML Foundations, pt 2HTML Foundations, pt 2
HTML Foundations, pt 2Shawn Calvert
 
Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptzahid7578
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLMayaLisa
 
Usability and accessibility on the web
Usability and accessibility on the webUsability and accessibility on the web
Usability and accessibility on the webVlad Posea
 
Intro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesIntro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesHeather Rock
 
HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2Sharon Wasden
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS PresentationShawn Calvert
 
Html Intro2
Html Intro2Html Intro2
Html Intro2mlackner
 
3 Layers of the Web - Part 1
3 Layers of the Web - Part 13 Layers of the Web - Part 1
3 Layers of the Web - Part 1Jeremy White
 

Tendances (20)

(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Introduction to XHTML
Introduction to XHTMLIntroduction to XHTML
Introduction to XHTML
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
HTML
HTMLHTML
HTML
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
 
HTML Foundations, pt 2
HTML Foundations, pt 2HTML Foundations, pt 2
HTML Foundations, pt 2
 
Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascript
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
 
Usability and accessibility on the web
Usability and accessibility on the webUsability and accessibility on the web
Usability and accessibility on the web
 
Intro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesIntro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 Slides
 
Html
HtmlHtml
Html
 
HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
Html Intro2
Html Intro2Html Intro2
Html Intro2
 
BasicHTML
BasicHTMLBasicHTML
BasicHTML
 
3 Layers of the Web - Part 1
3 Layers of the Web - Part 13 Layers of the Web - Part 1
3 Layers of the Web - Part 1
 
HTML & CSS
HTML & CSSHTML & CSS
HTML & CSS
 
Css notes
Css notesCss notes
Css notes
 

En vedette

Linked Open Data in Romania
Linked Open Data in RomaniaLinked Open Data in Romania
Linked Open Data in RomaniaVlad Posea
 
IPW 2eme course - HTML
IPW 2eme course - HTMLIPW 2eme course - HTML
IPW 2eme course - HTMLVlad Posea
 
Programarea calculatoarelor c2
Programarea calculatoarelor c2Programarea calculatoarelor c2
Programarea calculatoarelor c2Vlad Posea
 
C5 Javascript French
C5 Javascript FrenchC5 Javascript French
C5 Javascript FrenchVlad Posea
 
Ce mă fac când o să fiu mare - optiuni pentru o cariera in IT
Ce mă fac când o să fiu mare - optiuni pentru o cariera in ITCe mă fac când o să fiu mare - optiuni pentru o cariera in IT
Ce mă fac când o să fiu mare - optiuni pentru o cariera in ITVlad Posea
 
Introduction dans la Programmation Web Course 1
Introduction dans la Programmation Web Course 1Introduction dans la Programmation Web Course 1
Introduction dans la Programmation Web Course 1Vlad Posea
 
utilisabilite et accessibilite au web
utilisabilite et accessibilite au webutilisabilite et accessibilite au web
utilisabilite et accessibilite au webVlad Posea
 
HTML 5 - intro - en francais
HTML 5 - intro - en francaisHTML 5 - intro - en francais
HTML 5 - intro - en francaisVlad Posea
 
IPW Course 3 CSS
IPW Course 3 CSSIPW Course 3 CSS
IPW Course 3 CSSVlad Posea
 
Introduction to Web Programming - first course
Introduction to Web Programming - first courseIntroduction to Web Programming - first course
Introduction to Web Programming - first courseVlad Posea
 
Présentation html5
Présentation html5Présentation html5
Présentation html5Kénium
 
Beautiful CSS : Structurer, documenter, maintenir
Beautiful CSS : Structurer, documenter, maintenirBeautiful CSS : Structurer, documenter, maintenir
Beautiful CSS : Structurer, documenter, maintenirYves Van Goethem
 
Application web php5 html5 css3 bootstrap
Application web php5 html5 css3 bootstrapApplication web php5 html5 css3 bootstrap
Application web php5 html5 css3 bootstrapBassem ABCHA
 
Cours CSS feuilles de style en cascade- mars 2015
Cours CSS feuilles de style en cascade- mars 2015Cours CSS feuilles de style en cascade- mars 2015
Cours CSS feuilles de style en cascade- mars 2015Abdoulaye Dieng
 

En vedette (18)

Linked Open Data in Romania
Linked Open Data in RomaniaLinked Open Data in Romania
Linked Open Data in Romania
 
IPW 2eme course - HTML
IPW 2eme course - HTMLIPW 2eme course - HTML
IPW 2eme course - HTML
 
Programarea calculatoarelor c2
Programarea calculatoarelor c2Programarea calculatoarelor c2
Programarea calculatoarelor c2
 
C5 Javascript French
C5 Javascript FrenchC5 Javascript French
C5 Javascript French
 
Ce mă fac când o să fiu mare - optiuni pentru o cariera in IT
Ce mă fac când o să fiu mare - optiuni pentru o cariera in ITCe mă fac când o să fiu mare - optiuni pentru o cariera in IT
Ce mă fac când o să fiu mare - optiuni pentru o cariera in IT
 
C5 Javascript
C5 JavascriptC5 Javascript
C5 Javascript
 
Introduction dans la Programmation Web Course 1
Introduction dans la Programmation Web Course 1Introduction dans la Programmation Web Course 1
Introduction dans la Programmation Web Course 1
 
utilisabilite et accessibilite au web
utilisabilite et accessibilite au webutilisabilite et accessibilite au web
utilisabilite et accessibilite au web
 
HTML 5 - intro - en francais
HTML 5 - intro - en francaisHTML 5 - intro - en francais
HTML 5 - intro - en francais
 
IPW Course 3 CSS
IPW Course 3 CSSIPW Course 3 CSS
IPW Course 3 CSS
 
Introduction to Web Programming - first course
Introduction to Web Programming - first courseIntroduction to Web Programming - first course
Introduction to Web Programming - first course
 
Css+html
Css+htmlCss+html
Css+html
 
Présentation html5
Présentation html5Présentation html5
Présentation html5
 
Cours HTML/CSS
Cours HTML/CSSCours HTML/CSS
Cours HTML/CSS
 
Beautiful CSS : Structurer, documenter, maintenir
Beautiful CSS : Structurer, documenter, maintenirBeautiful CSS : Structurer, documenter, maintenir
Beautiful CSS : Structurer, documenter, maintenir
 
Application web php5 html5 css3 bootstrap
Application web php5 html5 css3 bootstrapApplication web php5 html5 css3 bootstrap
Application web php5 html5 css3 bootstrap
 
Initiation au css
Initiation au cssInitiation au css
Initiation au css
 
Cours CSS feuilles de style en cascade- mars 2015
Cours CSS feuilles de style en cascade- mars 2015Cours CSS feuilles de style en cascade- mars 2015
Cours CSS feuilles de style en cascade- mars 2015
 

Similaire à IPW HTML course

Similaire à IPW HTML course (20)

Html
HtmlHtml
Html
 
Html
HtmlHtml
Html
 
KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7
 
YL Intro html
YL Intro htmlYL Intro html
YL Intro html
 
Web Designing
Web DesigningWeb Designing
Web Designing
 
Diva
DivaDiva
Diva
 
Html
HtmlHtml
Html
 
Html
HtmlHtml
Html
 
Html
HtmlHtml
Html
 
Lect_html1
Lect_html1Lect_html1
Lect_html1
 
Html
HtmlHtml
Html
 
Html
HtmlHtml
Html
 
Html intro
Html introHtml intro
Html intro
 
Html intro
Html introHtml intro
Html intro
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Xhtml Part1
Xhtml Part1Xhtml Part1
Xhtml Part1
 
Michael(tm) Smith ED09 presentation
Michael(tm) Smith ED09 presentationMichael(tm) Smith ED09 presentation
Michael(tm) Smith ED09 presentation
 
Block2 Session2 Presentation
Block2 Session2 PresentationBlock2 Session2 Presentation
Block2 Session2 Presentation
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Everything You Always Wanted To Know About XML But Were Afraid To Ask
Everything You Always Wanted To Know About XML But Were Afraid To AskEverything You Always Wanted To Know About XML But Were Afraid To Ask
Everything You Always Wanted To Know About XML But Were Afraid To Ask
 

Plus de Vlad Posea

Design thinking
Design thinkingDesign thinking
Design thinkingVlad Posea
 
Talentul meu – mersul pe bicicletă
Talentul meu – mersul pe bicicletăTalentul meu – mersul pe bicicletă
Talentul meu – mersul pe bicicletăVlad Posea
 
Programarea calculatoarelor - Limbajul C
Programarea calculatoarelor   - Limbajul CProgramarea calculatoarelor   - Limbajul C
Programarea calculatoarelor - Limbajul CVlad Posea
 
Social semantic web
Social semantic webSocial semantic web
Social semantic webVlad Posea
 
Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012
Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012
Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012Vlad Posea
 
Javascript ajax tutorial
Javascript ajax tutorialJavascript ajax tutorial
Javascript ajax tutorialVlad Posea
 
Studiu Referitor La Insertia Pe Piata Muncii (1)
Studiu Referitor La Insertia Pe Piata Muncii (1)Studiu Referitor La Insertia Pe Piata Muncii (1)
Studiu Referitor La Insertia Pe Piata Muncii (1)Vlad Posea
 
Aplicații Web Semantice - Descriere Proiect
Aplicații Web Semantice - Descriere ProiectAplicații Web Semantice - Descriere Proiect
Aplicații Web Semantice - Descriere ProiectVlad Posea
 
Stagii In Strainatate
Stagii In StrainatateStagii In Strainatate
Stagii In StrainatateVlad Posea
 
Student si/sau Angajat
Student si/sau AngajatStudent si/sau Angajat
Student si/sau AngajatVlad Posea
 
Ghidul bobocului de la Facultatea de Automatica si Calculatoare
Ghidul bobocului de la Facultatea de Automatica si CalculatoareGhidul bobocului de la Facultatea de Automatica si Calculatoare
Ghidul bobocului de la Facultatea de Automatica si CalculatoareVlad Posea
 
Tips & Tricks Proiect
Tips & Tricks   ProiectTips & Tricks   Proiect
Tips & Tricks ProiectVlad Posea
 
Boboc Advisory Board Intalnire 1
Boboc Advisory Board Intalnire 1Boboc Advisory Board Intalnire 1
Boboc Advisory Board Intalnire 1Vlad Posea
 

Plus de Vlad Posea (14)

Design thinking
Design thinkingDesign thinking
Design thinking
 
Talentul meu – mersul pe bicicletă
Talentul meu – mersul pe bicicletăTalentul meu – mersul pe bicicletă
Talentul meu – mersul pe bicicletă
 
Programarea calculatoarelor - Limbajul C
Programarea calculatoarelor   - Limbajul CProgramarea calculatoarelor   - Limbajul C
Programarea calculatoarelor - Limbajul C
 
Social semantic web
Social semantic webSocial semantic web
Social semantic web
 
Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012
Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012
Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012
 
Json tutorial
Json tutorialJson tutorial
Json tutorial
 
Javascript ajax tutorial
Javascript ajax tutorialJavascript ajax tutorial
Javascript ajax tutorial
 
Studiu Referitor La Insertia Pe Piata Muncii (1)
Studiu Referitor La Insertia Pe Piata Muncii (1)Studiu Referitor La Insertia Pe Piata Muncii (1)
Studiu Referitor La Insertia Pe Piata Muncii (1)
 
Aplicații Web Semantice - Descriere Proiect
Aplicații Web Semantice - Descriere ProiectAplicații Web Semantice - Descriere Proiect
Aplicații Web Semantice - Descriere Proiect
 
Stagii In Strainatate
Stagii In StrainatateStagii In Strainatate
Stagii In Strainatate
 
Student si/sau Angajat
Student si/sau AngajatStudent si/sau Angajat
Student si/sau Angajat
 
Ghidul bobocului de la Facultatea de Automatica si Calculatoare
Ghidul bobocului de la Facultatea de Automatica si CalculatoareGhidul bobocului de la Facultatea de Automatica si Calculatoare
Ghidul bobocului de la Facultatea de Automatica si Calculatoare
 
Tips & Tricks Proiect
Tips & Tricks   ProiectTips & Tricks   Proiect
Tips & Tricks Proiect
 
Boboc Advisory Board Intalnire 1
Boboc Advisory Board Intalnire 1Boboc Advisory Board Intalnire 1
Boboc Advisory Board Intalnire 1
 

IPW HTML course

  • 1. Introduction to Web Programming (X)HTML
  • 2. Plan of the course XHTML and HTML Structure of a document Main HTML Tags Headings Paragraphs Links Tables Forms Images
  • 3. HTML HTML – HyperText Markup Language It’s a markup language – uses tags to describe web pages Currently used version – 4.01 - http://www.w3.org/TR/html401/ - from 1999!! HTML 5 – work in progress XHTML - http://www.w3.org/TR/xhtml1/ - same tags but using some XML constraints XML – extension markup language – generic language for structuring documents
  • 4. What is a html tag Keywords between “<“ and “>” There is usually a start tag and an end tag example: <tag>…</tag> Empty tags <tag /> Attributes An attribute is a pair of type name=“value” that is inside a tag <tag attribute=“value”> … </tag>
  • 5. Characteristics of tags Tags should always be closed “/>” be written in lowercase Be properly nested <tag1><tag2></tag2></tag1> <tag1><tag2></tag1></tag2>
  • 6. HTML and XHTML Browser work on “best effort” when interpreting an HTML file => one of the reasons pages look different in different browsers Because browsers try to interpret everything they have become heavy and slow. XHTML – a more strict syntax than HTML=>easier to parse by browsers
  • 7. Structure of a document Logical structure of a document Title of the document Titles of the different sections Content Paragraphs, quoted text, code Tabular information Lists of items (ordered or unordered) Very short example of document structure using Word
  • 8. Structure of an XHTML Document <html> <head> <title>the title of the document</title> </head> <body> <!-- the content of the document --> </body> </html>
  • 9. The head section Contains data about the document <title> - the actual document title – appears in the browser bar <link> - points to a resource used by the page (<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />) <meta> - defines meta information like keywords, content type, description – used by browsers and by spiders <script> - contains references to scripts
  • 10. Head Section Example <head> <title>W3Schools Online Web Tutorials</title> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta name="Keywords" content="XML,tutorial,HTML,DHTML,CSS,XSL,XHTML,JavaScript,ASP,ADO,VBScript,DOM, " /> <meta name="Description" content="HTML XHTML CSS JavaScript XML XSL ASP SQL ADO VBScript Tutorials References Examples" /> <link rel="stylesheet" type="text/css" href="stdtheme.css" /> </head>
  • 11. The body section Contains the tags that are displayed in the browser The body section SHOULD contain the content The style information should be placed in external documents (see next course) Elements are going to be presented next and we’re going to build a web page adding each element step by step
  • 12. Headings The titles of the sections H1…H6 Used by search engines to “understand” the structure of the document SHOULD NOT be used for style reasons (make text bigger and bolder) <h1>title of document</h1> <h2> title of first section</h2> <h3> title of the first sub-section</h3>
  • 13. Content and formatting <p>this is a paragraph</p> <br/> - passes to the next line <hr> - horizontal line <em> - emphasized text <strong> - strong text <small> - small text <sub> <sup>
  • 14. Lists Ordered lists (numbered, ordered with letters or roman numbers) - <ol> Unordered lists (bulleted) – <ul> Items of the list for each of the 2 types of lists - <li> Example: <ul> <li>red</li> <li>green</li> </ul>
  • 15. Links <a href=“absolute or relative url” target=“”>text or image</a> The target represents where the link should open Missing – the same page “_blank” – new window <a name=“name of an anchor in the same document> text or image </a> <a href=“#name of an anchor”>text or image</a>
  • 16. Images <img src=“absolute or relative url” alt=“alternative text in case the image can’t be displayed or can’t be understood”/> The “alt” attribute is mandatory in XHTML! the src can be a full url: http://host/path_to_file or a path relative to the current page.
  • 17. Tables Tables should ONLY be used for presenting tabular information They should not be used for design <table> <tr> <!--table row) --> <td > table cell</td> </tr> </table>
  • 18. Tables colspan used to have a cell that spans on multiple columns Attribute of the td element rowspan used to have a cell span on multiple rows Attribute of the td element Border If the table has a border or not Attribute of the table element
  • 19. Tables example <table border="1"> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> <table border="1"> <tr> <td colspan="2">&nbsp;</td> <!-- only 3 cells because 1 spans on 2 columns--> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td rowspan="2">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <!-- only 3 cells because 1 above spans on 2 rows --> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table>
  • 20. Forms Necessary to collect and submit data to the server <form action=“the server script that handles the submitted data” method=“the HTTP request method – GET or POST”> A form contains different kinds of input
  • 21. Form Inputs Text input <input type=“text” name=“” /> Checkbox <input type=“checkbox” name=“” value=“”/> Radio <input type=“radio” name=“” value=“”/> Text area <textarea name=“”></textarea> Submit <input type=“submit” value=“name on the button”/>
  • 22. Form example <form method="post" action="script.php"> Username: <input type="text" name="username" /><br /> Password:<input type="password" name="password" /><br /> Country: <select name="country"> <option value="eng">England</option> <option value="fra">France</option> <option value="rou" selected="selected">Romania</option> </select> <br /> Address: <textarea name="address"></textarea><br /> Type of account: <ul><li>Normal <input type="radio" name="account" value="normal" /></li> <li>Special <input type="radio" name="account" value="special" /></li> </ul> Do you want to subscribe to our newsletter <input type="checkbox" name="subscription"/><br /> <input type="submit" value="Register" /> </form>
  • 23. Others Html comments Whenever you write code you need to write comments <!-- this is a comment in html -->
  • 24. HTML Special Characters Some special characters <,>,’ ‘,& need to be represented differently in HTML There shouldn’t be confusion between the content of the page and the syntax The special characters are represented like:&code; Code is usually a 3-4 letter sequence that represents the special character
  • 25. HTML Special Characters & - &amp; ‘ ‘ (space) - &nbsp; “ - &quot; < - &lt; > - &gt; Others: http://www.w3schools.com/tags/ref_entities.asp http://www.w3schools.com/tags/ref_symbols.asp
  • 26. Conclusions In this course there are only the most important tags; more of them can be discovered as you work HTML should be used for presenting content in web pages The tags should be used according to their semantics