180 likes | 294 Views
Introduction to HTML/XHTML. Elena Pierazzo. GO HERE:. http :// www.cch.kcl.ac.uk/legacy/teaching/ma_foundation/HTML /. Markup languages. Markup before computers Computerised markup different languages (HTML, TACT …) different objectives variety of syntax
E N D
Introduction to HTML/XHTML Elena Pierazzo
GO HERE: http://www.cch.kcl.ac.uk/legacy/teaching/ma_foundation/HTML/
Markup languages • Markup before computers • Computerised markup • different languages (HTML, TACT …) • different objectives • variety of syntax • but what is the general objective?
SGML The markup language protagonist: SGML (Standard Generalised Markup Language) – ISO 8879:1986 and descendant: HTML and XML
Elements • Main structure of the languages based on SGML • Contains anything that can be viewed as a structural component of a text • “Structure” can be: a paragraph, a section but also a word or a single character or even the space between two words
Tags Elements are delimited by tags and enclose content <element>content</element> start-tag end-tag
Attributes Elements can have attributes to specify some detail, or classify, or…. <element attribute=“value”>content</element>
You can invent your own elements!! • Really! • But you have to declare them in a sort of a grammar called Document Type Definition or DTD • DTDs define: • Which elements you can use • Where you can use them • What content and attributes they can have • If the document respects the rules defined within the DTD, it is called valid
Relationship In SGML based languages relations among elements are: • Hierarchical • Ordinal Relations among elements can be described as family relations (parents, ancestor, children, siblings…)
Given 2 elements, A and B: • A follows B • B follows A • A contains B • B contains A
Nesting of elements <b><i>Some text</i></b>
Overlapping <b><i>Some text</b></i> but sometimes…
HTML the origin • “Invented” in 1991 by Tim Berners-Lee, based on SGML • Wrote the HTML DTD and the first browser • Date of birth of the WWW • He, and anybody else, could not have imagined… • The WWW in the ’90: the Wild, Wild West of HTML • 75% of the code used to produce a browses is to fix bad HTML
W3C • In 1994 the World Wide Web Consortium was funded by TBL • A sort of Guardian of the quality of the web: offer a validation service fro HTML, CSS and much more
XML • Invented in 1996, based on SGML • Simplification of SGML, too complex, too rich, too flexible • XML Few rules, but non flexible • E.g. overlapping is NOT allowed, EVER • Case sensitive
From HTML to XHTML • XHTML = an HTML written in XML (and not on SGML) • More rigorous and “clean” • Several flavours • Strict • Transitional • Frameset