Alright, let’s talk CSS.
I start all my stylesheets with a reset – you had the reset as a separate file, generally a good reset should be small enough there’s no reason to do that, and one less handshake can be anywhere from 200ms to a full two seconds speed up in page load time.
The reset I use is an ACTUAL reset, as in it sets the values I need consistent across all browsers that actually don’t start out the same way. There are larger resets like Meyer’s “reset reloaded” – the one you were using… but it wastes time setting values we’re probably just going to change anyways… it’s a massive bloated mess that is more framework than reset; and CSS frameworks are ALWAYS bad news… Meyers reset only got worse with the introduction of HTML 5. when you’re up to 1.11k of CSS before you even start your own styles, that’s going a bit far.
There are smaller resets than the one I use, most notably the ‘universal reset’ of * { padding:0; margin:0; } but that can cause headaches cross browser because it nabs EVERY tag, and for some tags like INPUT, SELECT and TEXTAREA that can actually make things worse.
The one I use is in the middle – a conservative quarter of a kilobyte, resetting just what I need reset.
… and we’re moving.
hr – as mentioned I just hide these for screen.css users. They are in there for non CSS users and to semantically break up the page. The second one in the markup before FOOTER in particular – if that wasn’t there the ‘footer’ would still be part of the h2 preceding it ‘structurally’.
body – I threw in the IE 5.5 centering fix just because most of your content was centered anyways and it’s only one tiny line. While IE5 shouldn’t matter anymore, you have to remember that on windows mobile devices IE6 is a new thing as of just four years ago… and IE6 remains what’s on the majority of Windows Mobile devices because there is no IE7 or later for them. What, you missed the “Six on Six” party M$ threw? That’s ok, so did everyone else… and they wonder why they can’t make headway in the mobile space.
I set the fonts sizes in % so they auto-enlarge for large font users like myself – all ‘content’ area fonts should whenever possible be based off the browser default size and not be declared in PX. In some places PX is what you have to do; your menu for example if allowed to auto-enlarge or auto-shrink would result in a broken layout… Setting a % on body and using that size and face on the majority of your content is usually your best bet, and then change that only in the handful of spots you ‘need’ px or different sizes.
… and of course no surprises from the body background… though notice on both font and background I’m using the ‘condensed’ properties. Cleaner, clearer, and less code.
#pageWrapper – width, centering, and a bit of top padding. Nothing fancy. Normally I would advise against building a page with a fixed width like that as it’s bad for accessibility, but your menu design and placement of the gallery stuff isn’t ‘viable’ for a fluid or semi-fluid layout. Media queries and changing the layout for different sizes remains an option though.
h1 – the position:relative is so I can absolute position the empty bold tag inside this for the image replacement. Fixed width, height and centering, with an overflow to ‘chop off’ the bold tag for when we move it on hover.
The negative bottom margin makes the menu ‘ride up’ over the h1.
The font size is for the first word… bringing us to:
h1 a – the display:block is to let us add padding if desired, not entirely necessary but nice to have. Turn off the underlines, set the color.
h1 a span – on this one the display:block makes the second word go to it’s own line. Change the font size,
You’ll notice we’re using PX fonts here – we have to due to the image being placed over them. %/em would auto-enlarge and therein possibly try to bust out of our container… px is usually bad from an accessibility standpoint, but thankfully in this case our smallest text is 22px, and it’s unlikely anyone is going to complain about that being ‘too small’.
Put it all together, and images off you still get a formatted text similar to your image!
h1 a:active span,
h1 a:focus span,
h1 a:hover span - and we can even replicate the hover state.
h1 a b – our image replacement sandbag. We absolute position it over the text hiding it. I set the height double high, so that we can use one image instead of two for that hover. This means a smaller single file (since they can share a palette and like mass-compression values)… so when we get to:
h1 a:active b,
h1 a:focus b,
h1 a:hover b – all we have to do is slide these up. The overflow chops off the difference. We could also slide the background, but for some reason that takes a bit longer to render, and since we’re already absolute positioned, it’s really splitting hairs as to how you move that image.
#mainMenu – turn off bullets, fix the height really tall to make sure our content is pushed down past the menu and the h1.
#mainMenu li – display:inline prevents IE7 from weirding out and ‘staircasing’ our anchors… and means we can use text-align:center on them instead of playing with floats and measured widths on everything. Wee bit of extra padding on them just spaced them apart a bit more.
#mainMenu a – inline-block allows us to set top/bottom paddings if needed, and makes it a predictable ‘block’ for showing the camera image. Again these are PX because of the fixed width, where auto-enlargement would break the layout. I put a more complete font-family stack in place as that’s just good practice, and you’ll notice that in addition to the darker (and more legible) color I attach the image BEFORE it’s hovered. This loads it ahead of time so there’s no delay the first time someone mouse-over’s it. Sliding it 99em out of the way hides it neatly until needed.
#mainMenu .logoGap a – you know what this does; margin to make room for the h1.
#mainMenu a:active,
#mainMenu a:focus,
#mainMenu a:hover – change the color and slide the background into place. Pretty simple.
h2 – padding, font, color. This gets a percentage font size so it’s twice the size of what we declared on body, which of course is the browser default size. That way on machines like mine all the content h2’s blow up 25% larger so I can read them.
#gallery – kill the bullets, set the special font. I use the full condensed property just because when you change face or size it’s more predictable if you change line-height – and by the time I say line-height and font-family, I could just say font with normal and the sizes.
#gallery li – display:inline means they’ll auto-center and again removes a slew of IE7 headaches.
#gallery a – inline-block lets us set a width, I made it 2px wider than the image to make room for that border on them. This means the background-image needs to be slid over. We can’t use the shorthand ‘background’ in the HTML or the CSS here because they’ll override each-other, and not in a consistent manner cross-browser.
#gallery a,
#footer a – these share color and:
#gallery a:active,
#gallery a:focus,
#gallery a:hover,
#footer a:active,
#footer a:focus,
#footer a:hover – hover effects, so I target them all at once.
#gallery img – the border and our CSS3 transitions. Even with the mess of browser specific prefixes this is still WAY nicer than trying to use jquery to do it. Transitions don’t work in IE9/lower, but I don’t consider that a real deal-breaker as the hover effect will still work, it just won’t have the fade. Oh noes, not that
#gallery a:active img,
#gallery a:focus img,
#gallery a:hover img – and of course the change to the image on hover… we just set it’s opacity to invisible. The ease-in-out CSS3 transition handles the rest.
#footer - we didn’t use any floats, so no clearing needed. The text-align lets us have our first bit of text on the left, some simple padding to make it pretty, font setting again in %, I went with 85% because it’s a sans-font and you can go a wee bit smaller with that than you can serif fonts. Color, border… simple.
#footer .facebook – float it right, pad it pretty and a bit of top/bottom padding to make room for the image. I put just the logo in as a background, and then retain the text setting it in PX (again due to the image interaction). Means smaller image and better images-off or CSS off functionality. We have two lines at 16px line height for 32px total, then the 2px top and bottom paddings add up to 36px, the size of that image.
#footer .facebook span – display:block moves the word ‘facebook!’ to a new line.
#footer .facebook:active,
#footer .facebook:focus,
#footer .facebook:hover – I use opacity here to give it a hover effect. The text ended up a bit too light so I just darken the color a hair which then gets lightened by the opacity setting along with the background image.
#footer ul – with that .facebook floated before it, NOW we should have a clear. Better safe than sorry. Kill the bullets, pad it, and center it.
#footer li put them all on one line.
#footer ul a as before inline-block so we can set dimensions if desired… the rest of our values get inherited off #footer a.
#footer div – the final bit of text just gets centered.
… and that’s it.
I know that’s a lot to take in all at once, but I hope this helps. Any questions fire away.