[thelist] HTTP headers for PDF files and IE - CSS Issue

ben morrison morrison.ben at gmail.com
Tue Oct 17 08:53:40 CDT 2006

On 16/10/06, Lee kowalkowski <lee.kowalkowski at googlemail.com> wrote:
> On 15/10/06, Bill Moseley <moseley at hank.org> wrote:
> > Speaking of IE, I have a CSS question.
> > --------------------------------------
> >    http://infopeople.org/pdf
> >
> > Now, with IE the averflow: auto has no effect and IE expands the
> > <pre>'s container to include all the <pre> text.  That makes that
> > column wider which doesn't leave room for the navigation.
> >
> > How do I tell IE to just let the <pre> text extend past the right
> > margin (like it does in Firefox)?  And also, why doesn't the overflow:
> > auto work?
> Not easy, IE won't give you scrollbars unless you constrain the box's
> dimensions.  Which means you'll also need a width:100%, but you'd have
> to see what other browsers make of that.

Your going to have to hack it for IE i'm afraid, and you will have to
use the container of the <pre> element for the overflow property.

So for example:

<div id="content">
<pre>Cache-Control: max-age=60
Connection: close
Date: Tue, 17 Oct 2006 13:29:03 GMT
Via: 1.1 infopeople.org
Server: Apache/2.0.54 (Debian GNU/Linux) mod_perl/2.0.2 Perl/v5.8.4
Content-Length: 3302
Content-Type: application/pdf
Expires: Tue, 17 Oct 2006 13:30:03 GMT
Client-Date: Tue, 17 Oct 2006 13:29:03 GMT
Client-Response-Num: 1

#content {

* html .content {
	overflow-x: auto;
    width: expression(document.body.offsetWidth - 500);

The width takes advantage of Microsoft's proprietary "expression" tag
to fix the browser's own bugs - it calculates the width of the block
to be the width of the page minus some predetermined offset (in this
case, the width of the two columns plus some padding). So IE will pop
up the horizontal scrollbar whenever the content exceeds this
dynamically-determined size.[1]

This also uses the * html hack, you may wish/prefer to use conditional
comments due to imminent release of ie7.

[1] http://crowstoburnaby.com/index.php/2005/02/07/fixing_the_pc_ie_float_drop_bug

Ben Morrison

More information about the thelist mailing list