Web Dev Philosophy
• Work out of respect for the design.
• Designers make our code as beautiful and
clever on the outside as it is on the inside.
• Respect the original design vision.
consistent design = clean code = fast site.
9 Best Practices
1. Create a component 5. Avoid non-standard
library of smart objects browser fonts.
2. Use consistent semantic 6. Use columns rather than
styles rows.
3. Design modules to be 7. Choose your bling
transparent on the carefully.
inside.
8. Be flexible.
4. Optimize images and
sprites. 9. Learn to love grids.
Contour blocks Background blocks Content Objects -
headings, paragraphs, lists, headers,
footers, buttons, etc.
Capital of the Canterbury region and the largest city
on the South Island (population just over 300,000)
exudes a palpable air of gentility and a connectedness
with the mother country.
Read more...
X X
1:n
Making it look
fab
Requires careful choice of pixels.
Bonus: Consider PNG8 for
progressive enhancement
http://alistapart.com/articles/mountaintop/
Optimize sprites
1. How many pages
does your property
have?
2. Is your site modular?
(hint: it should be!)
3. How much time can
your team spend on
site maintenance?
9 Image Optimizations
1. Combine like colors 6. Reduce anti-aliased pixels -
via size and alignment
2. Avoid whitespace
7. Avoid diagonal gradients
3. Horizontal better than
vertical 8. Avoid alpha transparency
4. Limit colors 9. Change gradient color
every 2-3 pixels
5. Optimize individual
images, then sprite
Avoid filters
Why is the AlphaImageLoader used?
IE6 and earlier don’t natively support alpha
transparency. This filter forces that support.
Problem with filters
• Blocks rendering, freezes the browser
• Increased memory consumption
• Per element, not per image!
Solution: Avoid
AlphaImageLoader
1. BEST: avoid completely, use PNG8 which degrades gracefully in IE < 7
2. Fallback: use underscore hack so the filter is applied only to IE < 7
#elem {
background: url(some.png);
_background: none;
_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader
(src='some.png', sizingMethod='crop');
}
Crush images
Step 1: Quality, Designer chooses quality (e.g. via save
for the web)
Step 2: Non-lossy compression to squeak the last
bytes out of the image.