I think I've found a good compromise - well, to be honest, I've copied from Hanselman's blog. Here it is:
pre {Noticed the overflow:auto? What it does is to show the code on all it's width if possible, and automatically pan when no width is available. Cool.
background-color:#FCFBF8;
border-color:#CCCCCC;
border-style:solid;
border-width:1px 1px 1px 2px;
line-height:1.2em;
margin:1em auto;
overflow:auto;
padding:1em;
width:90%;
word-wrap:normal; /* IE */
}
[update]
I've added word-wrap:normal, because of good old IE;
Thanks Mário.
ReplyDeleteI'm already using it in my blog.
An important thing also is that you have the "width: 90%". That way the block width never expands beyond your post width.