html5
What is html?
Ø acronym for hypertext markup language Ø hypertext means ability jump to another document (links) Ø markup is a language for describing web pages Ø markup tags define the structure of content in web pages Ø “view source” in any browser to see the html markup of a webpage
html document = web page
Ø html documents contain html tags and plain text to describe web pages Ø Web browsers (Chrome, Safari, Firefox, IE, Opera) read html documents and display them as web pages Ø Browsers use tags to interpret the structure (outline) of web page to create the DOM (document object model)
html tags
Ø html markup is called “tags” Ø tags are special keywords surrounded by angle brackets o
....
o exception is “empty tags” §html5
§ no closing tag because they don’t enclose anything; they are “empty” o First tag = start or open tag o Second tag= end or close tag
Example of bare minimum html document:
= specifies html5 rule set = html document
= instructions for the browser o meta, title, css, javascript = specifies character encodingfile extensions: Ø .html or html Ø .html more popular à better html5 cAsE SenSiTIvitY
Ø html5 is no longer case sensitive (however) Ø most developers keep their tags in lowercase for consistency (and as a nod to predecessor xhtml) Ø good writing style (convention)
Document Declaration
Ø you MUST specify the doctype in all of your html documents o tells the browser what type of document to expect and what rules to follow o consistent rendering across browsers o otherwise you get “quirks” mode § browser emulates 1990’s era browser § not good Ø the doctype declaration MUST be on the first line in your html document before the tag Ø doctype declaration for html Ø simplified version of previous doctypes rdfa-1.dtd”>
html Structure
Ø goal: to convey information as efficiently and clearly as possible html5
o what’s the most important feature of webpage? Ø Webpages are structured in outline form o headings o paragraphs o lists o figures (informational images) Ø parent-child relationships o most html elements can be “nested” (can contain other html elements) Ø good structure (conventional agreements) o accessibility o SEO (search engine optimization) o DOM (document object model)
html Structural Markup tags