---- Google Publishes HTML and CSS Best Practice Style Guide
lucy24 - 9:54 pm on May 2, 2012 (gmt 0)
< moved from another location >
Are they nuts? I'm not writing a CSS index, I'm writing a stylesheet. Declarations are grouped thematically, so I can find them: existing tags (format of <a> links, <em>, that kind of thing) headers, paragraphs, lists, tables, character modifiers...
Omit the protocol from embedded resources.
Omit type attributes for style sheets and scripts.
Use HTML5 / (It is recommended to use HTML, as text/html. Do not use XHTML. XHTML, as application/xhtml+xml, lacks both browser and infrastructure support and offers less room for optimization than HTML.)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Do not use entity references. / There is no need to use entity references like —, ”, or ☺, assuming the same encoding (UTF-8) is used for files and editors as well as among teams.
Great code has many attributes. It’s effective, efficient, maintainable, elegant.
Use 3 character hexadecimal notation where possible / For color values that permit it, 3 character hexadecimal notation is shorter and more succinct.
Use a space after a property name’s colon. / Always use a single space between property and value (but no space between property and colon) for consistency reasons.
margin:0; text-transform:uppercase; letter-spacing:.1em; font: normal normal 78% Arial, sans-serif; color: #666666;
[edited by: Robert_Charlton at 5:47 am (utc) on May 3, 2012] [edit reason] moved post from another location [/edit]