The web, HTML and all that stuff
Jan Henning Thorsen - YAPC::Europe::2008 - Copenhagen
»
Introduction - The web, HTML and all that stuff
- About me
- The web is messy
- Specification, specification, specification
Markup - HTML, XHTML, ...
-
DOCTYPE
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
- IMPORTANT! At char 1, line 1
-
Charset
- Unicode is your friend
- HTTP-header: Content-type: text/html; charset=utf-8
- HTML: <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-
Entities
-
Inline garbage
- <a href="foo" onclick="bah(.....)">link</a>
- <h2 style="font-size: 12pt; color: red; line-height: ....">heading</h2>
-
Bad tag! Bad!
- Use standard tags - not browser specific, nor "old tags"
- <font>, <blink> and <marquee> are evil
-
Frames?
- "Frames? They don't exist, forget you ever heard of them!"
-
Validation
Cascading stylesheets
-
How to include you styles
- <link rel="stylesheet" type="text/css" href="path/to/file.css">
- Pixels (px) are not your friend: px doesn't scale!
- Box model
JavaScript, jscript, js...
-
How to include your scripts
- <script type="text/javascript" src="path/to/file.js"></script>
- At the end of the document, if possible
-
JS-lib / frameworks
- jquery
- mochikit
- prototype
- Yahoo User Interface
- Dojo
- extjs
Availability
-
Test your site!
- IE
- Firefix
- Opera
- Safari
- Cellphones..?
- ...and lynx - or any other text based web browser
- Adobe flash
- CSS and Javascript
- Content is pri - not cool features
Tools
-
Firefox
- Firebug
- Web developer toolbar
-
IE
- IE developer toolbar
- Visual studio js-debugger
-
Opera