Sibling Rivalry

What happens when you tell two siblings to play nice together and share? Sometimes they listen and other times they fight. As a parent, I experience this with my own kids, but only one time have I ever experienced this in the browser landscape. Take the following example:

td { border-left: 1px solid #CCC; }
td:first-child,
td:last-child { border-left: none; }

IE7 correctly removes the border from the first table cell in each row, and doesn’t do anything with the last table cell (because it’s not supported). But in IE8 it’s a different story. Here, the two selectors fight it out like siblings! To illustrate, td:last-child basically says to td:first-child, “I know we’re supposed to share here, but I don’t want to share! Since I can’t use this, I’m going to take it from you so you can’t use it either.” Well, not really, but in technical terms, the entire declaration block gets discarded by IE8 when :first-child and :last-child are grouped together. To get this selector grouping to not cause problems in IE8, you have to separate the selectors into two different rules:

td:first-child { border-left: none; }
td:last-child { border-left: none; }

This will allow IE8 to correctly apply the style to the first table cell and do nothing with the last one.

I know, :last-child isn’t even supported in IE8 yet. Despite this shortcoming, I’ve decided to start using it anyway since I figured out a way to make it work in IE (more on that in another post). But this obscure bug in IE8 only makes me realize that testing in IE, even in the latest version with seemingly much better CSS support, is still a very important part of the front-end development process.

Great Designs Should Be Experienced and Not Seen

Great post by Jared Spool on how great design should be invisible to the user.

While all these things are what the designers at Netflix work hard on every day [great IA, Ajax, social networking integration], they go unmentioned by their customers. It’s not because these aspects aren’t important. It’s because the designers have done their job really well: they’ve made them invisible.

Jared Spool on Great Designs Should Be Experienced and Not Seen (via stopdesign)

F1 to Slice and Dice

For several years now I’ve been using a few actions in Photoshop for cropping and saving images. The one I use most is called “Flatten, Crop and Save for Web,” and it does just that. If I need to save an image with transparency, I turn the background layer off and use another action called “Crop and Save for Web.”

This has been working great for me but yesterday I read a post by Noah Stokes about using function keys as custom keyboard shortcuts in Photoshop for frequently used menu items. He assigns Crop to F1 and Save for Web to F2. Then it hit me, I could the same technique, but apply it to my existing actions! Now when I first make a selection in Photoshop, I can hit F1 to Flatten, Crop and Save for Web all at once!

To set this up, first you’ll need to set up your actions as shown below.

Actions Palette

Then select the action in your actions palette. In the actions palette menu, select “Action Options.” This is where you can assign a function key to the action.

Action Options