IE Whitespace Bug

02 Aug 2004

Its been a sort of Holy Grail for me (well maybe a Holy Teacup) to find a solution the IE Whitespace bug. If you’re not familiar with this, then you probably haven’t applied display:block to links within an unordered list. Adding this CSS property creates a solid ‘button’ out of what would’ve been a humble inline link, one that can be sized and prettied up as you like. The trouble is, IE windows adds another line height between all these links – unless you remove every bit of whitespace from the HTML.

So, in effect, there is already a fix to this, but it’s not a convenient one. Editing a menu that’s all on one line isn’t my idea of an easy life. Each time I would have to take the file into BBEdit, reformat the code to be ‘Gentle Hierarchal”, make my edits, and then reformat as ‘compact’.

I’d tried various fixes, one that added a negative top margin (overruled for decent browsers by using a first-child selector) worked in 5 & 6, but not 5.5. Then I started dreaming up some php that would strip the whitespace at the server side, but that was too much for my small head.

Now, excuse me if I’m late to the party, and everyone has already discovered the solution to this, but its actually rather simple. Here’s a cut down example:

ul a {
	display: block;
	float: left;
	clear: left;
}

Suddenly, IE 5+ does what it should, and the ones that got it right in the first place just put up with it without a fuss apart from Mozilla. If you find that the menu items are all over the place, add something like this:

li>a {
	float: none;
}

The first-child selector means that IE won’t see this rule, but everyone else will.

Recent Posts

Leigh and Jon did Inktober

01 Nov 2018

We are Oxvik

15 Oct 2018

The Hicks Logowall

05 Oct 2018

Hiding Away

16 Sep 2018

Biro sketch of Lauzerte

23 Aug 2018

Firefox Identity Project

21 Aug 2018

It’s just fashion

26 Jun 2018

The Symbol Sourcebook

08 Jun 2018

Differences between Icon and Logo Design on This is HCD Podcast

10 Apr 2018

Instagram Hickstagram

  • 11 Nov 2018

    It’s got to the PowerPoint presentation part of Gruff Rhys’ set.

  • 11 Nov 2018

  • 06 Nov 2018

    The light falling on @matthamm this afternoon was like a renaissance painting

  • 02 Nov 2018

    Vector illustration of a Tufted Duck, using @affinitybyserif Designer on the iPad Pro (+ Pencil). This app is a game changer, letting me do the kind of work I’d normally need a desktop computer and a Wacom tablet for. #illustration #birdillustration

  • 01 Nov 2018

  • 01 Nov 2018

  • 31 Oct 2018

    Inktober Day 31: last day! @hicksmade and I decided to finish on a joint drawing using the Inktober logo as the basis. It’s been really fun to do this together, and I never thought we’d manage to keep it up to the end 😊 #inktober #inktober2018 #leighandjondoinktober

  • 30 Oct 2018

    Inktober Day 30. Almost there! @hicksmade drew our retriever Olive, who was named after “Olive the other Reindeer” by J Otto Seibold. This is Olive, with Martini the Penguin, on their way to the North Pole. #inktober #inktober2018 #leighandjondoinktober

  • 29 Oct 2018

    Inktober Day 29. Taking the theme of ‘lies’ from @hicksmade’s post today, here’s a generic picture of a liar. No one particular in mind… #inktober #inktober2018 #leighandjondoinktober #liar

  • 29 Oct 2018

    Inktober Day 28. From @hicksmade’s Willo the Wisp character to its narrator, Kenneth Williams #inktober #inktober2018 #leighandjondoinktober

Contact us

Call Jon on +44 (0)7917 391536, email or tweet @hicksdesign.

Alternatively, pop in for tea and cake at the studio…

Hicks
Wenrisc House
Meadow Court
Witney, OX28 6ER
United Kingdom