Generating double borders with CSS04
May

I was working on a site the other day which had double borders around images. This is nothing new and is easily achievable with no extra markup and a bit of basic CSS. The problems arose when I wanted to achieve the same effect using a div.

Let’s start with the image example…

img {
background:#222;
padding:3px;
border:3px solid #666;
}

This gives us the following effect…

Baby red howler monkey which I photographed on the Tambopata river in Peru.

I then wanted to achieve the same effect with a div. The most obvious option was to use two divs and put one border on each div.


#innerDiv{
background:#fff;
border:3px solid #222;
padding:8px;
}
#outerDiv{
border:3px solid #666;
}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Morbi ultrices dignissim neque. Suspendisse potenti.

Although this worked I was not keen on using an extra div purely for presentational purposes and decided to work on a more css-based solution. I refreshed my knowledge of the CSS border property and then came up with the idea of combining border-style:ridge and border-style:groove to make a two-tone double border.


#myDiv1{
background:#fff;
padding:8px;
border-top:6px ridge #444;
border-right:6px groove #444;
border-bottom:6px groove #444;
border-left:6px ridge #444;
}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Morbi ultrices dignissim neque. Suspendisse potenti.

This approach enabled me to get a double border only using one div but it still had it’s limitations. The groove and ridge border styles spilt the border in half so for this example 3px and 3px it worked fine. However if I had wanted to make one border thicker than the other this would not have been possible. Also you only get to define a starting colour for the border, in this example #444. The browser then uses this to generate a lighter (#c6c6c6) and darker (#262626) border. Not being able to specify border colours and border widths meant that this solution was not feasible.

Finally I tried using the css outline property. CSS outlines are similar to borders but they do not take up any room on the page. This means that they overlap other elements that are next to them in the page. To counter act this it is therefore also necessary to add some margin to our div.


#myDiv2{
background:#fff;
padding:8px;
border:3px solid #222;
outline:3px solid #666;
margin:3px;
}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Morbi ultrices dignissim neque. Suspendisse potenti.

This solution enables us to control the thicknesses and colours of each border independently and does not require any extra html markup. This was the option that I went with.

EDIT 28/05/09: Unfortunately (but not suprisingly) this last option does not work in Internet Explorer due to lack of support for the CSS outline property. Back to the drawing board.

Designing the Firehorse Digital website04
Apr

Mozilla Firefox 3 T-Shirt Design26
Mar

Some time ago I learned about the Firefox 3 T-shirt Contest which was being used as part of the promotion for the new release of Firefox 3. Quite excited by this prospect I joined the flickr group, opened up Illustrator and started working on some ideas.

By the time the closing date arrived there where over 1,700 designs submitted which the team at Mozilla HQ then had to narrow down to their five favourites for the grand final. The top 5 designs where then announced to the public who had the opportunity to vote for the overall winner. Despite being well received by the flickr community my designs sadly where not selected and the winner of the competition was egirluk whose design (which I voted for) you can find out more about in the Mozilla store blog.

Several weeks later I received an exciting email from the comments form on my old website. It was an email from Mozilla HQ asking for permission to use one of my t-shirt designs (pictured below) to give away as the prize for their next competition. Naturally I was delighted and shipped the original Illustrator files off to Mountain View, California straight away. I understand that the screencast competition was a big success and I have since received my very own complimentary T-Shirt courtesy of the gang at Mozilla.

Thanks Mozilla.

The t-shirt design selected by Mozilla for use in their screencast competition.

If you would like to buy one of my T-shirts then you are able to do so at the Mozilla community store.

New blog theme finished23
Mar

Late last night I finished designing my new blog theme. I was feeling pretty tired and decided that it was time to hit the sack. I was on my way to the bathroom to brush my teeth when something rather strange happened.

Green shoes against a red textured wallpaper

En route to the bathroom I walked past a pair of shoes which my girlfriend had dropped in the hallway by the front door. I stopped mid step and did a double take, then it hit me… these shoes where a very similar colour to the main background colour used in the new blog theme.

Although this suprised me a little I didn’t think too much of it, after all there are lots of green things in my house. It was then that I noticed the wallpaper.

Much to my disbelief the wallpaper in the hallway (dusky red/pink colour) was almost identical to the other main accent colour from the new design. I had been walking down this same hallway many times a day since starting the new theme, was there some kind of connection or was I imagining it? Feeling somewhat confused I went back to the study and got the camera, above is the picture I took. I did not change any of the colours in photoshop and did no further design work on the blog after taking it. As you can see the similarity is quite astonishing.

How long had the shoes been lying there? Had the shoe/wallpaper combo subconsciously influenced my new blog theme? Or was the whole thing just a coincidence? I have no idea.

Halo Public Relations16
Mar

Yell.com Vista gadget15
Mar

The Yell.com Vista gadget project was a follow on from the Yell.com google gadget project. Unsuprisingly the functionality and design of the main body of the vista gadget is very similar to it’s google counterpart.

The default view (docked view) of the gadget is simply a Yell.com logo. This decision was made to minimise the amount of space the gadget took up on the sidebar. Clicking the docked gadget displays a secondary screen (AKA flyout) with a three box business search form. Clicking the map tab opens up a new form enabling the user to search for a map of their entered location.

Yell.com Vista gadget screenshot

In addition to the docked state and the two flyout views there is a user preferences tool panel for the gadget. This allows the user to customise the gadget to suit their personal needs.

  • A default location can be entered (perhaps the user’s home town) to pre-populate the search flyout.
  • The default flyout can be changed from the business search to the maps search.
  • The gadgets tooltips can be hidden, this is a feature which displays on the maps tab and alerts users to options available in the tool panel.

Vista gadget user preferences tool panel

The gadget is largely built using html, css and javascript but it also makes use of the Vista gadget API to display background images, trigger flyout animations and to set/get user preferences. Once completed the gadget project folder is zipped up, renamed from .zip to .gadget and uploaded to the Windows Live gallery where it can be downloaded, rated and reviewed by anyone running Windows Vista.

So far the Yell.com Vista gadget has been downloaded 1684 times and has generated over 6,000 searches in the last 12 months. If you are a Windows Vista user you can get the gadget for free from the Windows Live gallery.