CSS Mastery Sample Chapter | January 29, 2006

My new book, CSS Mastery: Advanced Web Standards Solutions hits the shelves on the 13th of February. However you don’t need to wait that long to get a glimpse inside. Simply visit the new support site at www.cssmastery.com and you can download a sample chapter and table of contents absolutely free.

Screenshot of cssmastery.com

Happy reading.

Comments (21)

Four Things: The Madness Stops Here | January 25, 2006

I generally don’t like memes, but this one got passed to me by Steve and it would have been rude to say no!

Four jobs I’ve had in my life

To name but a few.

Four movies I can watch over and over

Four TV shows I love to watch

Four places I have lived

Four places I have been on holiday (in the last year and a half)

Four of my favourite dishes

Four websites I visit daily

And that’s about it at the moment. I’ve been so busy the last 6 months I’ve not had chance to keep track of my favorite sites. Definitely not on a daily basis anyway.

Four places I would rather be right now

Four bloggers I am tagging

Comments (13)

Streaming Music to Multiple Speakers using iTunes | January 24, 2006

I really like Airport Express as it allows me to stream music from my iMac to the stereo in my living room. This is particularly handy when we have guests around as I can stick iTunes on party shuffle and not have to worry about music for the rest of the evening (for extra geek cred you can control iTunes with your mobile phone using salling clicker). If I had a bigger flat I’d probably consider getting a few more Airport Express units and hooking them up to stereos in the bedroom and kitchen. If the rumours are true, Tom Coates has 5 of the things. Now that’s just showing off.

Anyway, the one thing that has always bothered me is you could only ever listen to music on one device at a time. If you had iTunes streaming to the living room, you couldn’t listed to the music on your Mac in the bedroom. Luckily now you can. In fact you can stream your music to any and all the remote speakers on your network, so you can sashay through your home barely missing a beat.

For this to work you need to have iTunes 6.0.2 installed. You also need to download and install the latest Airport Express Firmware. Once your Airport Expresses reboot after the firmware update, you should see a new “multiple speakers” option in your speakers dropdown. Clicking on this will bring up a list of your connected speakers, allowing you to choose which ones you want to stream music to. Sweet.

Comments (7)

What I Want From CSS3 - Part 3 | January 24, 2006

As you probably all know, the box model looks like this.

CSS Box Model

You start with the content area, then you have your padding and border, followed lastly by your margin. When debugging your code you can get an idea of how elements are interacting by giving them a border or a background colour. This will tell you what is happening with the space formed by the content area, padding and border, but gives you no information about the elements margins. There is simply no way to see what an elements margins are doing.

This is a big problem as margins can collapse with other margins, causing all kinds of weird and wonderful effects.

Margin Collapsing

I think two new CSS features would be extremely useful. Firstly I’d like to be able to add a margin-outline to boxes in order to show exactly how their margins are interacting. Secondly, it would be great to have control over margin collapsing, in the same way as you can control table border collapsing. So you could turn on and off the collapsing behaviour by doing something like this:

body {margin-collapse: none;}

p {margin-collapse: collapse;}

Now that would be cool

Comments (14)

What I Want From CSS3 - Part 2 | January 22, 2006

CSS allows you to move down through the document tree and select elements based on their ancestry. So you can style one element that is a descendant of another element. For more control you can use the child selector to style the direct children of particular element, rather than all of its descendants. The child selector is usually used in situations where you know the parent and want to style the children.

<div id="parent">This is the parent
  <div>This is the child (I want to style this)
    <div>This is the grandchild</div>

#parent>div {...}

The problem is, I often find myself in the reverse situation, where I know the child and want to style its parent.

<div>This is the parent (I want to style this)
  <div id="child">This is the child
    <div>This is the grandchild</div>

Currently the only way you can do that is to identify the parent by using a class or id name.

<div id="parent">This is the parent (I want to style this)
  <div>This is the child
    <div>This is the grandchild</div>

#parent {...}

However this means adding extra mark-up to your documents and forms a bit of a code dependancy, where removing the child necessitates removing the identifier on the parent. This can be done programatically, but is less than ideal.

What I really want is a parent selector. That way, you could simply do this:

div<#child {...}

It’s a little more difficult to read as it doesn’t follow the current expectation that the right most selector refers to the element being styled. However it wouldn’t have an adverse effect on the cascade and could come in extremely handy in certain situations.

Comments (25)

Removing iPod Nano Scratches - A Photo Essay | January 21, 2006

Take one scratched iPod

and one can of Brasso

Apply Brasso in a circular motion

Remove Brasso with a clean cloth

Result: one scratch-free iPod Nano

Comments (16)