IE vertical scrollbar and overflow:auto

Comments (0)

I've recently updated all my code samples to display in an easier-to-read format for my readers and came across a couple of bugs/issues. One of them is the overflow:auto vertical scrollbar bug. See the below picture for an example of how the code on my site appears in IE7 with the pre element set to overflow:auto, not very pretty, as we obviously expect the element to expand vertically within the parent container.

Fortunately, it's an easy fix with a small quirks mode snippet as follows;

<!--[if IE]>
<style type="text/css">pre,code {padding-bottom:16px;overflow:visible;overflow-x:auto;overflow-y:hidden}</style>
<![endif]-->

Place that code in the head, just make sure that it is placed after all the other styles.

bookmark / share this: Bookmark and Share
rated 4/5 (2 votes)

Comments

No comments posted yet, why not be the first?


Write a comment

* = required field

:

:

:

:

You may insert urls in plain text, urls will be automatically linkified for trusted users and on seasoned posts only. All first comments are moderated, so use your email if you want to be remembered.


Back to top