Wednesday, October 11, 2006

Scrolling wide pre-formatted text

There are places on this blog, where I have had to post overly wide pre-formatted text. Normally these are code, command-line or file snippets. By default in the theme/template I am using this causes the text to run into the sidebar.

To correct this, I added the following CSS code to the blogger template just above the footer formatting information.
pre {
overflow: auto;
line-height: 1;
margin: 1em;
padding: 1em;
background: #cdf;
color: #330;
border: 1px solid #fff; }
The idea for this came from pre-formated text with scroll bars at 100% width - HTML. It may not be perfect and well-styled, which is my fault, but it works.

No comments: