Categories
HTML

Recommended doctype to use

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.
w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
Categories
HTML

Browser Quirks mode

When no correct doctype available, browsers fail into quirks mode by default thinking this is an old page written in the times where there were no doctypes available.

It is limited and hard to format (needless to say) avoid it like the plague.

Keyword: best practices

Keyword: doctype

Categories
HTML

h1 tag

Use one per page (ideally), this is your main title.

Categories
HTML

table tag

Use it for tabular data (spreadsheets and reports)

Categories
HTML

span tag

Shows inline (with no breaks) with other content around.

Used when you want to apply styling to just one element within a div or an area.

Categories
HTML

div tag

By being in a document, it implies a break before and after it

Use it to gain control over entire sections of a page with CSS. It can enclose other elements inside of it.

Categories
HTML

Differences between HTML 4.01 and XHTML

HTML 4.01    
 Allows upper / lowercase tags 
 Non-close tags, others (sloppy) 
 doesn’t require a Doctype 
XHTML    
 More strict, therefore easier to verify  
 Based on XML  
 Requires a doctype  
 In theory you can extend it to add your own tags
 Even empty tags must be closed
 Attributes must be ” ” tized