I have an unordered list whose list items are displaying inline. However, its layout is rather complicated, so let me show you the Fiddle:
- Fullscreen: http://jsfiddle.net/spryno724/F5CFD/embedded/result/
- Code: http://jsfiddle.net/spryno724/F5CFD/
Notice how the unordered list items stretch to the height of the tallest list item, using the display: table-cell property (except for the first list item). This allows the first list item to have a vertical line extend the entire height of the unordered list, with the letter “A” vertically aligned to the top.
This presentation works excellent in most browsers, with the notable exception of Internet Explorer 8[1], of course. Here are some screenshots, in case you don’t have IE8:
- Excellent rendering in Chrome: https://picasaweb.google.com/lh/photo/oI6rWHT8iS_0nKVQRb1o_hV2JJooBc4dMF1MOKsl3b4?feat=directlink
- IE8 rendering the same page, with the IE developer tools highlighting the erratic width of the third list item: https://picasaweb.google.com/lh/photo/_n-WvfHYgUrPJ6jTdk24KxV2JJooBc4dMF1MOKsl3b4?feat=directlink
Any ideas what I can do to keep the same look as you see in Chrome (or any other browser other than IE1-IE8)?
Thank you for your time.
[1] What have we ever done to you IE8 that you hate us so???
Unfortunately, IE doesn’t render the table-cell property, so you have to resort to various hacks. Fortunately, this one works pretty well.
This will allow the elements to align in an inline-block fashion in IE, giving you cross-browser inline elements.