Archive for the ‘WordPress’ Category

Fixing the <code> width with <pre>

Thursday, January 10th, 2008

I wanted a way to set apart code, and that was easy enough to find. I had to add a scrollbar to prevent display weirdness, like text leaving the box. I open a <pre> tag, then a <code> tag and put the contents in, then close the tags </code></pre>. I changed the style.css to outline and provide an outline. The background color didn’t work in Firefox but I haven’t tested it in IE yet.

pre {
	border: solid 1px blue;
	font-size: 1.3 em;
 	color: blue;
	margin: 10px;
	padding:10px;
	background-color: #FFFFB3
	width: 100%;
	overflow: auto;
	/*overflow:-moz-scrollbars-horizontal;
	overflow-x:scroll;*/
	}
code {
	font: 1.1em 'Courier New', Courier, Fixed;
	color: #008899
	}