Hi, I’m Brian Dys — a photographer from the inside looking out · a composer entangled in electronic music · a UX designer · a spouse, a parent, & everything in between.
Say you want to center your navigation on the page:
Simply tell CSS to:
And don’t forget to remove any float on those elements, if any.
We’ve been following Yahoo!’s Best Practices for Speeding Up Your Web Site for quite a while now and have been fine in following some of the tips — that we’ve forgotten to extend out our antennas to hear about what’s going on out there in the world of website page load performance.
This one isn’t really that technical but a “perceived performance” — it’s making your JPEGs progressive (basically if it larger than 10k in file size).
There is also an interlaced “Progressive JPEG” format, in which data is compressed in multiple passes of progressively higher detail. This is ideal for large images that will be displayed while downloading over a slow connection, allowing a reasonable preview after receiving only a portion of the data.
Instead of waiting for that JPEG image load line per line, what you would see at first is a pixelated version of the image in full size and it improves its quality as it downloads.
Read more about it in Progressive jpegs: a new best practice by Ann Robson
In a quest to streamline and improve our HTML markup, I’m looking at how the page would appear to a person using an assistive device such as a screen reader.
I’ve installed Fangs – a Firefox extension that “helps developers find accessibility issues in web pages and managers to understand how their website may appear to a person using an assistive device.”
In Fangs preferences, switch the output style to “Sectioned” to have an overview of the sectioning of the HTML document — this is related to checking the outline.
Editing HTML5 Boilerplate 4.1.0
- Edit line: <meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1.5“>
- For mobile device browsers, set the initial scale to 100% zoom and limit the zooming to 150%
- New line: <link rel=”shortcut icon” href=”img/favicon.ico”>
- Place your icon inside the img folder
- New line: <link rel=”stylesheet” href=”css/ui.css”>
- Start with a blank stylesheet alongside normalize and main.css
While we’re waiting for the vector format to come across the web, we’re left to “fake” it out — our images (excluding photographs) times two (x2) to create a high-pixel-density image.
While we’re at it, let’s see how we can consolidate all those icons into one file and in hi-res fashion.
We have website icons sized 16px, 24px, 32px, etc. While laying it out in Illustrator or Photoshop, size wouldn’t really matter — just make it larger than 48 x 48 pixels.
Set out your canvas in a fixed manner — if you’ve settled with 48px, then multiply it by 10 and have a 480px wide canvas. It could contain 10 48px icons across.
In you CSS:
background-position:-32px 0; /* in increments of 32 pixels */
Let’s get to the details on how to write the HTML markup, really.
- Write pure text of everything
- Enclose all texts in semantic HTML tags — don’t use <div> and <span>
- Add lists — <ul>, <ol>
- Add headings — use only <h1>
- Add sectioning elements like <header>, <nav>, <section>
- Check document outline
HTML (weighing on content structure and document outline)
- Write HTML5 tags
- No <div>s, no <span>s
- Check if HTML elements are sematic
- Check document outline
- Use <div>s and <span>s for visual design-specific purposes
CSS (weighing on mobile-first layout)
- Write styles
- No floats
- No positions
- Set color and background-color
- Set images
- Looks good on small devices? Move on to the next size