Julian Klewes

Show code on wordpress css

Tagged

Categorized
Dated
This article was posted in SeptemberAugust 22, 2007







Hi, one of the people commenting here asked for a way of displaying code in one of my themes.
For ages I have been using the following code and it worked flawless in connection with the code markup plugin for wordpress:


.primary pre#hack {
		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 */
		word-wrap: break-word;		/* Internet Explorer 5.5+ */
}

.primary pre {
  overflow: auto;
  cursor:pointer;
  position:relative;
}

.primary pre code {
  display: block;
  margin:10px;
  padding:4px;
  border:1px solid #ddd;
  background:#F5F5F5;
  font:10px Lucida Sans Typewriter, Courier, monospace;
}
.primary can be changed to what you need, e.g. .post or .entry

Usage within Wordpress
Simply go to the “code” editor of Wordpress and paste your code.
Surround it by a

 and  tag and add the id of "hack" to the
.
(
 stuff here  

If you enjoyed this post, make sure you subscribe to my RSS feed!

share me please

h4x3d.com does not host any illegal content. Links/Files referred to are for educational purposes only.

Interact - Leave a comment

Engage in the conversion and leave a comment.
I would much love to hear from you. Please note however that comments are moderated by default. Advertising and rant is welcomed, yet often discarded...
See left/right for additional information













2

May 3, 20092:55 pm
May 3rd, 2009 2:55 pm

mssmotorrd

It’s the first time I commented here and I must say you share us genuine, and quality information for bloggers! Good job.
p.s. You have a very good template for your blog. Where did you find it?

comment? jump to the form



archives | sitemap | contact | tos

advertise
advertise

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

solarVPS.com - reliale enterprise hosting
you know the game, get in touch with me