CSS

code filter module for displaying code in a drupal post

This site uses code filter module to diplay code correctly in posts.

use <pre> and <code> tags to wrap your code.

<p>this is a p tag</p>
<h1>this is an h1 tag </h1>

I also put this in my style.css file in this drupal installation:

pre {
	overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
	white-space: pre-wrap; /* css-3 */
	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
	white-space: -pre-wrap; /* Opera 4-6 */
	white-space: -o-pre-wrap; /* Opera 7 */ /*
	width: 99%; */
	word-wrap: break-word; /* Internet Explorer 5.5+ */
}

making <pre> tags make code snippets show up in a browser nicely

I found this here and use it on this site: http://www.sohtanaka.com/web-design/styling-pre-tags-with-css-code-block/

I put this in my style.css file in this drupal installation:

pre {
	overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
	white-space: pre-wrap; /* css-3 */
	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
	white-space: -pre-wrap; /* Opera 4-6 */
	white-space: -o-pre-wrap; /* Opera 7 */ /*
	width: 99%; */
	word-wrap: break-word; /* Internet Explorer 5.5+ */
}