180 likes | 307 Vues
This guide delves into the evolution and structure of markup languages, focusing on HTML and XHTML, which are built upon SGML (Standard Generalized Markup Language). It explores the foundational elements of these languages, including tags, attributes, and the significance of Document Type Definitions (DTDs) that validate the structure of documents. Learn about the hierarchical relationships between elements, the history of HTML's invention by Tim Berners-Lee, and the role of the World Wide Web Consortium (W3C) in maintaining web standards. Discover the transition from HTML to XHTML and the importance of adhering to syntax rules in web development.
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