HTML & XHTML Basics

Hossein Zahed
Hossein ZahedLead Software Engineer en Maersk
HTML & XHTML
1

HOSSEIN ZAHED
AMIR KABIR UNIVERSITY OF TECHNOLOGY
HTTP://WWW.HZAHED.COM
HOSSEIN.ASPX@GMAIL.COM

© 2013 Hossein Zahed - www.hzahed.com
Using HTML/XHTML
2

 XHTML is relatively simple. You do most of your

work with about twenty tags.
 XHTML is orderly and structured
 Good references and tutorial sites are available
 Follow the standards and your work will be much
simpler, more consistent, and your results more
reliable


Plus your co-workers will like you more

© 2013 Hossein Zahed - www.hzahed.com
Device Independence
3

Your audience may view your site with many
different devices and browser types.
© 2013 Hossein Zahed - www.hzahed.com
The Browser
4

The browser is not print!
© 2013 Hossein Zahed - www.hzahed.com
The Browser Is Not Print
5

 No fixed page size
 No fixed page length
 User can change the font size
 User can link to her/his own local style sheet
 Screen size can be tiny or huge

© 2013 Hossein Zahed - www.hzahed.com
The Adjustable Document
6

© 2013 Hossein Zahed - www.hzahed.com
The Birth of HTML
7

 Created by Tim Berners-Lee at

CERN
 Open standard developed under
supervision of the World Wide
Web Consortium (www.w3.org)

© 2013 Hossein Zahed - www.hzahed.com
The History of HTML/XHTML
8











1992 – HTML first defined
1994 – HTML 2.0
1995 – Netscape specific non-standard HTML
1996 – HTML 3.2, compromise version
1997 – HTML 4.0, separates content from presentation
1998 – XML standard for writing Web languages
2000 – XHTML 1.0, XML compliant HTML
2002 – XHTML 2.0
2008 – HTML 5.0

© 2013 Hossein Zahed - www.hzahed.com
Problems With HTML
9

 In Large Scale Websites (Large number of HTML






pages) changing anything is very hard
Lack of Visual Effects in presentation
Lack of Programming features, only Static Pages
allowed. No database can be used
Cross Browser Problems (Chrome, IE, Firefox)
Lack of Multimedia support (Videos, Music, Flash
Animation)

© 2013 Hossein Zahed - www.hzahed.com
XHTML
10

 XHTML is a version of HTML modified to conform to the

XML standard
 Designed to separate content from presentation



Content in XHTML
Presentation controlled by Cascading Style Sheets (CSS)

 Extensible – Additional elements can be defined

 XML Compatible – Other XML based languages can be

embedded in XHTML documents
 Like a programming language



Specific syntax to use
Validators help you get it right

© 2013 Hossein Zahed - www.hzahed.com
XHTML Differences
11

 Case is significant
 All elements must have begin tags and end tags

<p>Hello</p>
 Empty elements contain their own end tag
<br /> , <hr/>
 Attribute values must be enclosed in quotation
marks
 More specifics available at
http://www.w3.org/TR/xhtml1/#diffs

© 2013 Hossein Zahed - www.hzahed.com
A Simple XHTML File
12

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>
My Home Page
</title>
</head>
<body>
<h1>My Home Page </h1>
<p>
Welcome to my home page
</p>
</body>
</html>
© 2013 Hossein Zahed - www.hzahed.com
Hierarchical Structure
13

Well formed xhtml forms a hierarchy
© 2013 Hossein Zahed - www.hzahed.com
Content Types
14

Documents are made up of logical types of content.
© 2013 Hossein Zahed - www.hzahed.com
Semantic Structure
15

Content of the same type usually is formatted to look the
same.
© 2013 Hossein Zahed - www.hzahed.com
Semantic Markup
16

HTML markup is based on logical content types
© 2013 Hossein Zahed - www.hzahed.com
Hierarchy
17

The resulting hierarchy
© 2013 Hossein Zahed - www.hzahed.com
The DOCTYPE Statement
18

 Declares the specific version of HTML or XHTML

being used on the page
 Used by the browser to decide how to process the
page
 Three types
Transitional - Forgiving
 Strict – Requires adherence to standards
 Frameset – Use if page has frames


 Always first in file

© 2013 Hossein Zahed - www.hzahed.com
Strict DOCTYPE
19

 Enter exactly as below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN―
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 Using Strict encourages standards based coding



Validators will flag logical errors in your methods
Your CSS will work better and more predictably

© 2013 Hossein Zahed - www.hzahed.com
Elements
20

 Consist of three parts
 Begin tag, which can contain attributes
 Contents
 End tag
 Example:

<p id=―intro‖>Welcome</p>
 W3schools specifications for <p>
http://www.w3schools.com/tags/tag_p.asp

© 2013 Hossein Zahed - www.hzahed.com
Attributes
21

 Always only used in the element begin tag
 Three types
 Optional attributes: Varies with element type
 Standard attributes: id, class, title, style, dir, lang,
xml:lang
 Event attributes: onclick, ondblclick, onmousedown,
onmouseup, onmouseover, onmousemove, onmouseout,
onkeypress, onkeydown, onkeyup


Used in scripting

© 2013 Hossein Zahed - www.hzahed.com
Empty Elements
22

 Some elements have no content and therefore also

have no end tag

<img src=―photo.jpg‖ />
 <br />
 <hr />
 <link rel="stylesheet" type="text/css" href=―main.css" />


 In XHTML, which requires end tags on all

elements, a single tag represents both the begin
and end tag

© 2013 Hossein Zahed - www.hzahed.com
Heading
23

 <h1>, <h2>, … , <h6>
 Headings on the page
 Represent the main topic, subtopics, subsubtopics,

etc. of the page
 Important to use they in a logical manner, which
greatly helps assistive technology like voice browsers
present the page content intelligibly

© 2013 Hossein Zahed - www.hzahed.com
Paragraph
24

 <p>
 Paragraph
 Important for presentation control to put text in an

element. When in doubt, put text in a paragraph
 Blockquotes (<blockquote>) except they have wider
left and right margins

© 2013 Hossein Zahed - www.hzahed.com
List
25

 Unordered lists (bulleted lists)

<ul>
<li>One</li>
<li>Two</li>
</ul>
 Ordered lists (numbered lists)
<ol>
<li>One</li>
<li>Two</li>
</ol>

© 2013 Hossein Zahed - www.hzahed.com
Text Markup
26

 Bolding
 <b>text</b>
 <strong>text</strong>
 Italics
 <i>text</i>
 <em>text</em>
 Other
 <sub>text</sub> subscript
 <sup>text</sup> superscript
 <del>text</del> deleted text

© 2013 Hossein Zahed - www.hzahed.com
Table
27

<table border="1" cellspacing="5" cellpadding="10">
<caption>People on the team</caption>
<tr>
<th>Name</th>
<th>Position</th>
</tr>
<tr>
<td>Mary</td>
<td>Analyst</td>
</tr>
<tr>
<td>John</td>
<td>Technician</td>
</tr>
</table>
© 2013 Hossein Zahed - www.hzahed.com
Graphic (Image)
28

 Graphics are placed by using an img element
 The alt attribute provides alternative text describing

the graphic in case the graphic itself cannot be
shown or the user cannot see the graphic

<img src="picture.gif" alt="Suzzallo― />

© 2013 Hossein Zahed - www.hzahed.com
Anchor (Link)
29

 Anchors can link your page to any file, page, URL on

the Web OR to a section on the same page

<a href="http://www.washington.edu/">
University of Washington </a>

© 2013 Hossein Zahed - www.hzahed.com
Div
30

 <div>
 Divs enclose a set of elements

<div style=―text-align: center;‖>
<h2> News</h2>
<p><a href=―budget.html‖>Budget</a></p>
<p><a href=―invest.html‖>Investment</a></p>
</div>

© 2013 Hossein Zahed - www.hzahed.com
Span
31

 <span>
 Spans enclose objects (text, graphics) within an

element
<p>Call me Ishmael. Some years ago — <span style=―fontstyle: italic;‖>never mind how long precisely</span> —
having little or no money in my purse, and nothing
particular to interest me on shore,

© 2013 Hossein Zahed - www.hzahed.com
Form
32

 HTML forms are used to pass data to a server
 An HTML form can contain input elements like
 Text Fields
 Checkboxes
 Radio-Buttons
 Submit Buttons and more
 Textarea
 Fieldset
 Legend
 Label

© 2013 Hossein Zahed - www.hzahed.com
Form Tags
33

 <input type="text"> Defines a one-line input field







that a user can enter text into
<input type="password"> Defines a password field
<input type="radio"> Defines a radio button.
Radio buttons let a user select ONLY ONE of a
limited number of choices
<input type="checkbox"> Defines a checkbox.
Checkboxes let a user select ZERO or MORE
options of a limited number of choices
<input type="submit"> Defines a submit button

© 2013 Hossein Zahed - www.hzahed.com
Form Tags
34

 <fieldset> Draws a box around the related

elements
 <legend> Defines a caption for the <fieldset>
element
 <select> Is used to create a drop-down list
 <option> Inside the <select> element define the
available options in the list

© 2013 Hossein Zahed - www.hzahed.com
Other HTML Tags
35

 <style> Defines style information for an HTML









document
<meta> Provides metadata about the HTML document.
Metadata will not be displayed on the page, but will be
machine pars able.
<script> Contains scripting statements, or it points to an
external script file through the src attribute. (Like
JavaScript, VB Script)
<embed> Defines a container for an external application
or interactive content (a plug-in like Flash, YouTube).
<iframe> An inline frame is used to embed another
document within the current HTML document.
<hidden> Defines a hidden input field

© 2013 Hossein Zahed - www.hzahed.com
HTML5 New Tags
36

<canvas> Draws Graphics on the fly
<video> Defines a video or movie
<audio> Defines sound content
<source> Defines multiple media resources
<article> Defines an article
<dialog> Defines a dialog box or window
<header> Defines a header for a document or section
<footer> Defines a footer for a document or section
<mark> Defines marked / highlighted text
<meter> Defines a scalar measurement within a known
range
 <time> Defines a date/time











© 2013 Hossein Zahed - www.hzahed.com
Resources
37

 W3schools


http://www.w3schools.com/

 RADCOM (Farsi Language)


http://www.html.ir

© 2013 Hossein Zahed - www.hzahed.com
1 de 37

Recomendados

CSS Basics por
CSS BasicsCSS Basics
CSS BasicsHossein Zahed
1.4K vistas10 diapositivas
Html - By Auroskkil por
Html - By AuroskkilHtml - By Auroskkil
Html - By AuroskkilBoneyGawande
30 vistas18 diapositivas
Html basics-auro skills por
Html basics-auro skillsHtml basics-auro skills
Html basics-auro skillsBoneyGawande
32 vistas47 diapositivas
CSS-3 Course Slide por
CSS-3 Course SlideCSS-3 Course Slide
CSS-3 Course SlideBoneyGawande
24 vistas21 diapositivas
HTML/CSS Lecture 1 por
HTML/CSS Lecture 1HTML/CSS Lecture 1
HTML/CSS Lecture 1Lee Lundrigan
5.5K vistas31 diapositivas
Css presentation lecture 1 por
Css presentation lecture 1Css presentation lecture 1
Css presentation lecture 1Mudasir Syed
529 vistas30 diapositivas

Más contenido relacionado

La actualidad más candente

HTML, CSS and Java Scripts Basics por
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsSun Technlogies
4.7K vistas223 diapositivas
Introduction to HTML and CSS por
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSMario Hernandez
4.2K vistas39 diapositivas
HTML Lecture Part 1 of 2 por
HTML Lecture Part 1 of 2HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2Sharon Wasden
10.1K vistas22 diapositivas
Presentation on html, css por
Presentation on html, cssPresentation on html, css
Presentation on html, cssAamir Sohail
584 vistas24 diapositivas
Internet and Web Technology (CLASS-4) [CSS & JS] por
Internet and Web Technology (CLASS-4) [CSS & JS] Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS] Ayes Chinmay
311 vistas18 diapositivas
HTML CSS | Computer Science por
HTML CSS | Computer ScienceHTML CSS | Computer Science
HTML CSS | Computer ScienceTransweb Global Inc
1.2K vistas7 diapositivas

La actualidad más candente(20)

HTML, CSS and Java Scripts Basics por Sun Technlogies
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
Sun Technlogies4.7K vistas
Introduction to HTML and CSS por Mario Hernandez
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Mario Hernandez4.2K vistas
HTML Lecture Part 1 of 2 por Sharon Wasden
HTML Lecture Part 1 of 2HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2
Sharon Wasden10.1K vistas
Presentation on html, css por Aamir Sohail
Presentation on html, cssPresentation on html, css
Presentation on html, css
Aamir Sohail584 vistas
Internet and Web Technology (CLASS-4) [CSS & JS] por Ayes Chinmay
Internet and Web Technology (CLASS-4) [CSS & JS] Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS]
Ayes Chinmay311 vistas
Boostrap basics por JTechTown
Boostrap basicsBoostrap basics
Boostrap basics
JTechTown22 vistas
Introduction to web design discussing which languages is used for website des... por Aditya Dwivedi
Introduction to web design discussing which languages is used for website des...Introduction to web design discussing which languages is used for website des...
Introduction to web design discussing which languages is used for website des...
Aditya Dwivedi190 vistas
Introduction of Html/css/js por Knoldus Inc.
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
Knoldus Inc.22.6K vistas
Html / CSS Presentation por Shawn Calvert
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
Shawn Calvert78.9K vistas
An Overview of HTML, CSS & Java Script por Fahim Abdullah
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
Fahim Abdullah11.4K vistas
Html & CSS - Best practices 2-hour-workshop por Vero Rebagliatte
Html & CSS - Best practices 2-hour-workshopHtml & CSS - Best practices 2-hour-workshop
Html & CSS - Best practices 2-hour-workshop
Vero Rebagliatte4.2K vistas
HTML CSS Best Practices por hoctudau
HTML CSS Best PracticesHTML CSS Best Practices
HTML CSS Best Practices
hoctudau3.4K vistas
Introduction to HTML por Amit Tyagi
Introduction to HTMLIntroduction to HTML
Introduction to HTML
Amit Tyagi6.8K vistas
Introduction to html course digital markerters por SEO SKills
Introduction to html course digital markertersIntroduction to html course digital markerters
Introduction to html course digital markerters
SEO SKills2.4K vistas
HTML/CSS Crash Course (april 4 2017) por Daniel Friedman
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)
Daniel Friedman627 vistas
Web I - 02 - XHTML Introduction por Randy Connolly
Web I - 02 - XHTML IntroductionWeb I - 02 - XHTML Introduction
Web I - 02 - XHTML Introduction
Randy Connolly4.4K vistas
HTML CSS JS in Nut shell por Ashwin Shiv
HTML  CSS JS in Nut shellHTML  CSS JS in Nut shell
HTML CSS JS in Nut shell
Ashwin Shiv253 vistas
Intro to HTML & CSS por Syed Sami
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
Syed Sami1.1K vistas

Destacado

ASP.NET MVC 5 - EF 6 - VS2015 por
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015Hossein Zahed
3.4K vistas148 diapositivas
Web II - 02 - How ASP.NET Works por
Web II - 02 - How ASP.NET WorksWeb II - 02 - How ASP.NET Works
Web II - 02 - How ASP.NET WorksRandy Connolly
10.4K vistas98 diapositivas
Big Data World por
Big Data WorldBig Data World
Big Data WorldHossein Zahed
6.8K vistas80 diapositivas
Entity Framework Overview por
Entity Framework OverviewEntity Framework Overview
Entity Framework Overviewukdpe
2.7K vistas23 diapositivas
ASP.NET 02 - How ASP.NET Works por
ASP.NET 02 - How ASP.NET WorksASP.NET 02 - How ASP.NET Works
ASP.NET 02 - How ASP.NET WorksRandy Connolly
15.8K vistas34 diapositivas
ASP.NET 12 - State Management por
ASP.NET 12 - State ManagementASP.NET 12 - State Management
ASP.NET 12 - State ManagementRandy Connolly
3.3K vistas37 diapositivas

Destacado(20)

ASP.NET MVC 5 - EF 6 - VS2015 por Hossein Zahed
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed3.4K vistas
Web II - 02 - How ASP.NET Works por Randy Connolly
Web II - 02 - How ASP.NET WorksWeb II - 02 - How ASP.NET Works
Web II - 02 - How ASP.NET Works
Randy Connolly10.4K vistas
Entity Framework Overview por ukdpe
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
ukdpe2.7K vistas
ASP.NET 02 - How ASP.NET Works por Randy Connolly
ASP.NET 02 - How ASP.NET WorksASP.NET 02 - How ASP.NET Works
ASP.NET 02 - How ASP.NET Works
Randy Connolly15.8K vistas
ASP.NET 12 - State Management por Randy Connolly
ASP.NET 12 - State ManagementASP.NET 12 - State Management
ASP.NET 12 - State Management
Randy Connolly3.3K vistas
CSharp Language Overview Part 1 por Hossein Zahed
CSharp Language Overview Part 1CSharp Language Overview Part 1
CSharp Language Overview Part 1
Hossein Zahed1.8K vistas
Microsoft SQL Server 2008 por Hossein Zahed
Microsoft SQL Server 2008Microsoft SQL Server 2008
Microsoft SQL Server 2008
Hossein Zahed1.6K vistas
Dot net interview questions por Netra Wable
Dot net interview questionsDot net interview questions
Dot net interview questions
Netra Wable837 vistas
Top 15-asp-dot-net-interview-questions-and-answers por sonia merchant
Top 15-asp-dot-net-interview-questions-and-answersTop 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
sonia merchant287 vistas
Dot Net Accenture por Sri K
Dot Net AccentureDot Net Accenture
Dot Net Accenture
Sri K13K vistas
Top 20 Asp.net interview Question and answers por w3asp dotnet
Top 20 Asp.net interview Question and answersTop 20 Asp.net interview Question and answers
Top 20 Asp.net interview Question and answers
w3asp dotnet1.3K vistas
Top 20 c# interview Question and answers por w3asp dotnet
Top 20 c# interview Question and answersTop 20 c# interview Question and answers
Top 20 c# interview Question and answers
w3asp dotnet2.3K vistas
Cts informatica interview question answers por Sweta Singh
Cts informatica interview question answersCts informatica interview question answers
Cts informatica interview question answers
Sweta Singh25.1K vistas
DotNet &amp; Sql Server Interview Questions por Neeraj Kaushik
DotNet &amp; Sql Server Interview QuestionsDotNet &amp; Sql Server Interview Questions
DotNet &amp; Sql Server Interview Questions
Neeraj Kaushik4.5K vistas
important DotNet Questions For Practicals And Interviews por Rahul Jain
important DotNet Questions For Practicals And Interviewsimportant DotNet Questions For Practicals And Interviews
important DotNet Questions For Practicals And Interviews
Rahul Jain1.2K vistas
Top 100 .Net Interview Questions and Answer por Vineet Kumar Saini
Top 100 .Net Interview Questions and AnswerTop 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and Answer
Vineet Kumar Saini17.7K vistas
Accenture informatica interview question answers por Sweta Singh
Accenture informatica interview question answersAccenture informatica interview question answers
Accenture informatica interview question answers
Sweta Singh73.9K vistas

Similar a HTML & XHTML Basics

Session no 1 html por
Session no 1 htmlSession no 1 html
Session no 1 htmlSaif Ullah Dar
1.1K vistas35 diapositivas
Cascading Style Sheets - CSS - Tutorial por
Cascading Style Sheets - CSS  -  TutorialCascading Style Sheets - CSS  -  Tutorial
Cascading Style Sheets - CSS - TutorialMSA Technosoft
210 vistas53 diapositivas
Html5 css3 por
Html5 css3Html5 css3
Html5 css3Altaf Pinjari
329 vistas40 diapositivas
Web design and Development por
Web design and DevelopmentWeb design and Development
Web design and DevelopmentShagor Ahmed
130 vistas155 diapositivas
Web Design Basics por
Web Design BasicsWeb Design Basics
Web Design BasicsCindy Royal
664 vistas13 diapositivas
HTML & CSS 2017 por
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017Colin Loretz
237 vistas117 diapositivas

Similar a HTML & XHTML Basics(20)

Cascading Style Sheets - CSS - Tutorial por MSA Technosoft
Cascading Style Sheets - CSS  -  TutorialCascading Style Sheets - CSS  -  Tutorial
Cascading Style Sheets - CSS - Tutorial
MSA Technosoft210 vistas
Web design and Development por Shagor Ahmed
Web design and DevelopmentWeb design and Development
Web design and Development
Shagor Ahmed130 vistas
Web Design Basics por Cindy Royal
Web Design BasicsWeb Design Basics
Web Design Basics
Cindy Royal664 vistas
Vijay it 2 year por shahilgupta
Vijay it 2 yearVijay it 2 year
Vijay it 2 year
shahilgupta339 vistas
wd project.pptx por dsffsdf1
wd project.pptxwd project.pptx
wd project.pptx
dsffsdf126 vistas
Advanced Web Programming Chapter 8 por RohanMistry15
Advanced Web Programming Chapter 8Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8
RohanMistry1520 vistas
Css training tutorial css3 &amp; css4 essentials por QA TrainingHub
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
QA TrainingHub216 vistas
GDI Seattle Intermediate HTML and CSS Class 1 por Heather Rock
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
Heather Rock786 vistas
The HTML Beginner Tutorial por Sukh Sandhu
The HTML Beginner Tutorial The HTML Beginner Tutorial
The HTML Beginner Tutorial
Sukh Sandhu1.2K vistas
Introduction to whats new in css3 por Usman Mehmood
Introduction to whats new in css3Introduction to whats new in css3
Introduction to whats new in css3
Usman Mehmood891 vistas

Más de Hossein Zahed

Machine Learning with ML.NET por
Machine Learning with ML.NETMachine Learning with ML.NET
Machine Learning with ML.NETHossein Zahed
14 vistas9 diapositivas
8 Database Paradigms por
8 Database Paradigms8 Database Paradigms
8 Database ParadigmsHossein Zahed
96 vistas10 diapositivas
مبانی رایانش ابری por
مبانی رایانش ابریمبانی رایانش ابری
مبانی رایانش ابریHossein Zahed
45 vistas9 diapositivas
HTTPS نحوه کارکرد پروتکل por
HTTPS نحوه کارکرد پروتکلHTTPS نحوه کارکرد پروتکل
HTTPS نحوه کارکرد پروتکلHossein Zahed
16 vistas17 diapositivas
مبانی چابکی و اسکرام por
مبانی چابکی و اسکراممبانی چابکی و اسکرام
مبانی چابکی و اسکرامHossein Zahed
13 vistas8 diapositivas
آموزش سی شارپ - بخش 1 por
آموزش سی شارپ - بخش 1آموزش سی شارپ - بخش 1
آموزش سی شارپ - بخش 1Hossein Zahed
11 vistas11 diapositivas

Más de Hossein Zahed(13)

Machine Learning with ML.NET por Hossein Zahed
Machine Learning with ML.NETMachine Learning with ML.NET
Machine Learning with ML.NET
Hossein Zahed14 vistas
مبانی رایانش ابری por Hossein Zahed
مبانی رایانش ابریمبانی رایانش ابری
مبانی رایانش ابری
Hossein Zahed45 vistas
HTTPS نحوه کارکرد پروتکل por Hossein Zahed
HTTPS نحوه کارکرد پروتکلHTTPS نحوه کارکرد پروتکل
HTTPS نحوه کارکرد پروتکل
Hossein Zahed16 vistas
مبانی چابکی و اسکرام por Hossein Zahed
مبانی چابکی و اسکراممبانی چابکی و اسکرام
مبانی چابکی و اسکرام
Hossein Zahed13 vistas
آموزش سی شارپ - بخش 1 por Hossein Zahed
آموزش سی شارپ - بخش 1آموزش سی شارپ - بخش 1
آموزش سی شارپ - بخش 1
Hossein Zahed11 vistas
فرآیند توسعه نرم افزار por Hossein Zahed
فرآیند توسعه نرم افزارفرآیند توسعه نرم افزار
فرآیند توسعه نرم افزار
Hossein Zahed17 vistas
تخته سیاه آنلاین por Hossein Zahed
تخته سیاه آنلاینتخته سیاه آنلاین
تخته سیاه آنلاین
Hossein Zahed10 vistas
مفاهیم اساسی برنامه نویسی کامپیوتر por Hossein Zahed
مفاهیم اساسی برنامه نویسی کامپیوترمفاهیم اساسی برنامه نویسی کامپیوتر
مفاهیم اساسی برنامه نویسی کامپیوتر
Hossein Zahed29 vistas
Network Essentials v2.0 por Hossein Zahed
Network Essentials v2.0Network Essentials v2.0
Network Essentials v2.0
Hossein Zahed2.4K vistas

Último

Berry country.pdf por
Berry country.pdfBerry country.pdf
Berry country.pdfMariaKenney3
80 vistas12 diapositivas
Pharmaceutical Analysis PPT (BP 102T) por
Pharmaceutical Analysis PPT (BP 102T) Pharmaceutical Analysis PPT (BP 102T)
Pharmaceutical Analysis PPT (BP 102T) yakshpharmacy009
116 vistas29 diapositivas
Introduction to AERO Supply Chain - #BEAERO Trainning program por
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning programGuennoun Wajih
123 vistas78 diapositivas
Java Simplified: Understanding Programming Basics por
Java Simplified: Understanding Programming BasicsJava Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming BasicsAkshaj Vadakkath Joshy
663 vistas155 diapositivas
BUSINESS ETHICS MODULE 1 UNIT I_B.pdf por
BUSINESS ETHICS MODULE 1 UNIT I_B.pdfBUSINESS ETHICS MODULE 1 UNIT I_B.pdf
BUSINESS ETHICS MODULE 1 UNIT I_B.pdfDr Vijay Vishwakarma
52 vistas21 diapositivas
The Picture Of A Photograph por
The Picture Of A PhotographThe Picture Of A Photograph
The Picture Of A PhotographEvelyn Donaldson
37 vistas81 diapositivas

Último(20)

Pharmaceutical Analysis PPT (BP 102T) por yakshpharmacy009
Pharmaceutical Analysis PPT (BP 102T) Pharmaceutical Analysis PPT (BP 102T)
Pharmaceutical Analysis PPT (BP 102T)
yakshpharmacy009116 vistas
Introduction to AERO Supply Chain - #BEAERO Trainning program por Guennoun Wajih
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning program
Guennoun Wajih123 vistas
ANGULARJS.pdf por ArthyR3
ANGULARJS.pdfANGULARJS.pdf
ANGULARJS.pdf
ArthyR352 vistas
11.21.23 Economic Precarity and Global Economic Forces.pptx por mary850239
11.21.23 Economic Precarity and Global Economic Forces.pptx11.21.23 Economic Precarity and Global Economic Forces.pptx
11.21.23 Economic Precarity and Global Economic Forces.pptx
mary85023952 vistas
GSoC 2024 .pdf por ShabNaz2
GSoC 2024 .pdfGSoC 2024 .pdf
GSoC 2024 .pdf
ShabNaz242 vistas
11.30.23A Poverty and Inequality in America.pptx por mary850239
11.30.23A Poverty and Inequality in America.pptx11.30.23A Poverty and Inequality in America.pptx
11.30.23A Poverty and Inequality in America.pptx
mary850239181 vistas
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating... por Taste
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Taste38 vistas
12.5.23 Poverty and Precarity.pptx por mary850239
12.5.23 Poverty and Precarity.pptx12.5.23 Poverty and Precarity.pptx
12.5.23 Poverty and Precarity.pptx
mary850239514 vistas
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (FRIE... por Nguyen Thanh Tu Collection
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (FRIE...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (FRIE...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (FRIE...
Peripheral artery diseases by Dr. Garvit.pptx por garvitnanecha
Peripheral artery diseases by Dr. Garvit.pptxPeripheral artery diseases by Dr. Garvit.pptx
Peripheral artery diseases by Dr. Garvit.pptx
garvitnanecha124 vistas
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption... por BC Chew
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
BC Chew38 vistas

HTML & XHTML Basics

  • 1. HTML & XHTML 1 HOSSEIN ZAHED AMIR KABIR UNIVERSITY OF TECHNOLOGY HTTP://WWW.HZAHED.COM HOSSEIN.ASPX@GMAIL.COM © 2013 Hossein Zahed - www.hzahed.com
  • 2. Using HTML/XHTML 2  XHTML is relatively simple. You do most of your work with about twenty tags.  XHTML is orderly and structured  Good references and tutorial sites are available  Follow the standards and your work will be much simpler, more consistent, and your results more reliable  Plus your co-workers will like you more © 2013 Hossein Zahed - www.hzahed.com
  • 3. Device Independence 3 Your audience may view your site with many different devices and browser types. © 2013 Hossein Zahed - www.hzahed.com
  • 4. The Browser 4 The browser is not print! © 2013 Hossein Zahed - www.hzahed.com
  • 5. The Browser Is Not Print 5  No fixed page size  No fixed page length  User can change the font size  User can link to her/his own local style sheet  Screen size can be tiny or huge © 2013 Hossein Zahed - www.hzahed.com
  • 6. The Adjustable Document 6 © 2013 Hossein Zahed - www.hzahed.com
  • 7. The Birth of HTML 7  Created by Tim Berners-Lee at CERN  Open standard developed under supervision of the World Wide Web Consortium (www.w3.org) © 2013 Hossein Zahed - www.hzahed.com
  • 8. The History of HTML/XHTML 8          1992 – HTML first defined 1994 – HTML 2.0 1995 – Netscape specific non-standard HTML 1996 – HTML 3.2, compromise version 1997 – HTML 4.0, separates content from presentation 1998 – XML standard for writing Web languages 2000 – XHTML 1.0, XML compliant HTML 2002 – XHTML 2.0 2008 – HTML 5.0 © 2013 Hossein Zahed - www.hzahed.com
  • 9. Problems With HTML 9  In Large Scale Websites (Large number of HTML     pages) changing anything is very hard Lack of Visual Effects in presentation Lack of Programming features, only Static Pages allowed. No database can be used Cross Browser Problems (Chrome, IE, Firefox) Lack of Multimedia support (Videos, Music, Flash Animation) © 2013 Hossein Zahed - www.hzahed.com
  • 10. XHTML 10  XHTML is a version of HTML modified to conform to the XML standard  Designed to separate content from presentation   Content in XHTML Presentation controlled by Cascading Style Sheets (CSS)  Extensible – Additional elements can be defined  XML Compatible – Other XML based languages can be embedded in XHTML documents  Like a programming language   Specific syntax to use Validators help you get it right © 2013 Hossein Zahed - www.hzahed.com
  • 11. XHTML Differences 11  Case is significant  All elements must have begin tags and end tags <p>Hello</p>  Empty elements contain their own end tag <br /> , <hr/>  Attribute values must be enclosed in quotation marks  More specifics available at http://www.w3.org/TR/xhtml1/#diffs © 2013 Hossein Zahed - www.hzahed.com
  • 12. A Simple XHTML File 12 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title> My Home Page </title> </head> <body> <h1>My Home Page </h1> <p> Welcome to my home page </p> </body> </html> © 2013 Hossein Zahed - www.hzahed.com
  • 13. Hierarchical Structure 13 Well formed xhtml forms a hierarchy © 2013 Hossein Zahed - www.hzahed.com
  • 14. Content Types 14 Documents are made up of logical types of content. © 2013 Hossein Zahed - www.hzahed.com
  • 15. Semantic Structure 15 Content of the same type usually is formatted to look the same. © 2013 Hossein Zahed - www.hzahed.com
  • 16. Semantic Markup 16 HTML markup is based on logical content types © 2013 Hossein Zahed - www.hzahed.com
  • 17. Hierarchy 17 The resulting hierarchy © 2013 Hossein Zahed - www.hzahed.com
  • 18. The DOCTYPE Statement 18  Declares the specific version of HTML or XHTML being used on the page  Used by the browser to decide how to process the page  Three types Transitional - Forgiving  Strict – Requires adherence to standards  Frameset – Use if page has frames   Always first in file © 2013 Hossein Zahed - www.hzahed.com
  • 19. Strict DOCTYPE 19  Enter exactly as below <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN― "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  Using Strict encourages standards based coding   Validators will flag logical errors in your methods Your CSS will work better and more predictably © 2013 Hossein Zahed - www.hzahed.com
  • 20. Elements 20  Consist of three parts  Begin tag, which can contain attributes  Contents  End tag  Example: <p id=―intro‖>Welcome</p>  W3schools specifications for <p> http://www.w3schools.com/tags/tag_p.asp © 2013 Hossein Zahed - www.hzahed.com
  • 21. Attributes 21  Always only used in the element begin tag  Three types  Optional attributes: Varies with element type  Standard attributes: id, class, title, style, dir, lang, xml:lang  Event attributes: onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup  Used in scripting © 2013 Hossein Zahed - www.hzahed.com
  • 22. Empty Elements 22  Some elements have no content and therefore also have no end tag <img src=―photo.jpg‖ />  <br />  <hr />  <link rel="stylesheet" type="text/css" href=―main.css" />   In XHTML, which requires end tags on all elements, a single tag represents both the begin and end tag © 2013 Hossein Zahed - www.hzahed.com
  • 23. Heading 23  <h1>, <h2>, … , <h6>  Headings on the page  Represent the main topic, subtopics, subsubtopics, etc. of the page  Important to use they in a logical manner, which greatly helps assistive technology like voice browsers present the page content intelligibly © 2013 Hossein Zahed - www.hzahed.com
  • 24. Paragraph 24  <p>  Paragraph  Important for presentation control to put text in an element. When in doubt, put text in a paragraph  Blockquotes (<blockquote>) except they have wider left and right margins © 2013 Hossein Zahed - www.hzahed.com
  • 25. List 25  Unordered lists (bulleted lists) <ul> <li>One</li> <li>Two</li> </ul>  Ordered lists (numbered lists) <ol> <li>One</li> <li>Two</li> </ol> © 2013 Hossein Zahed - www.hzahed.com
  • 26. Text Markup 26  Bolding  <b>text</b>  <strong>text</strong>  Italics  <i>text</i>  <em>text</em>  Other  <sub>text</sub> subscript  <sup>text</sup> superscript  <del>text</del> deleted text © 2013 Hossein Zahed - www.hzahed.com
  • 27. Table 27 <table border="1" cellspacing="5" cellpadding="10"> <caption>People on the team</caption> <tr> <th>Name</th> <th>Position</th> </tr> <tr> <td>Mary</td> <td>Analyst</td> </tr> <tr> <td>John</td> <td>Technician</td> </tr> </table> © 2013 Hossein Zahed - www.hzahed.com
  • 28. Graphic (Image) 28  Graphics are placed by using an img element  The alt attribute provides alternative text describing the graphic in case the graphic itself cannot be shown or the user cannot see the graphic <img src="picture.gif" alt="Suzzallo― /> © 2013 Hossein Zahed - www.hzahed.com
  • 29. Anchor (Link) 29  Anchors can link your page to any file, page, URL on the Web OR to a section on the same page <a href="http://www.washington.edu/"> University of Washington </a> © 2013 Hossein Zahed - www.hzahed.com
  • 30. Div 30  <div>  Divs enclose a set of elements <div style=―text-align: center;‖> <h2> News</h2> <p><a href=―budget.html‖>Budget</a></p> <p><a href=―invest.html‖>Investment</a></p> </div> © 2013 Hossein Zahed - www.hzahed.com
  • 31. Span 31  <span>  Spans enclose objects (text, graphics) within an element <p>Call me Ishmael. Some years ago — <span style=―fontstyle: italic;‖>never mind how long precisely</span> — having little or no money in my purse, and nothing particular to interest me on shore, © 2013 Hossein Zahed - www.hzahed.com
  • 32. Form 32  HTML forms are used to pass data to a server  An HTML form can contain input elements like  Text Fields  Checkboxes  Radio-Buttons  Submit Buttons and more  Textarea  Fieldset  Legend  Label © 2013 Hossein Zahed - www.hzahed.com
  • 33. Form Tags 33  <input type="text"> Defines a one-line input field     that a user can enter text into <input type="password"> Defines a password field <input type="radio"> Defines a radio button. Radio buttons let a user select ONLY ONE of a limited number of choices <input type="checkbox"> Defines a checkbox. Checkboxes let a user select ZERO or MORE options of a limited number of choices <input type="submit"> Defines a submit button © 2013 Hossein Zahed - www.hzahed.com
  • 34. Form Tags 34  <fieldset> Draws a box around the related elements  <legend> Defines a caption for the <fieldset> element  <select> Is used to create a drop-down list  <option> Inside the <select> element define the available options in the list © 2013 Hossein Zahed - www.hzahed.com
  • 35. Other HTML Tags 35  <style> Defines style information for an HTML      document <meta> Provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine pars able. <script> Contains scripting statements, or it points to an external script file through the src attribute. (Like JavaScript, VB Script) <embed> Defines a container for an external application or interactive content (a plug-in like Flash, YouTube). <iframe> An inline frame is used to embed another document within the current HTML document. <hidden> Defines a hidden input field © 2013 Hossein Zahed - www.hzahed.com
  • 36. HTML5 New Tags 36 <canvas> Draws Graphics on the fly <video> Defines a video or movie <audio> Defines sound content <source> Defines multiple media resources <article> Defines an article <dialog> Defines a dialog box or window <header> Defines a header for a document or section <footer> Defines a footer for a document or section <mark> Defines marked / highlighted text <meter> Defines a scalar measurement within a known range  <time> Defines a date/time           © 2013 Hossein Zahed - www.hzahed.com
  • 37. Resources 37  W3schools  http://www.w3schools.com/  RADCOM (Farsi Language)  http://www.html.ir © 2013 Hossein Zahed - www.hzahed.com