Monthly Archives: December 2010

Displaying code in wordpress

There are a few ways to show your readers actual html code, php code or any other code without getting it converted by the browser into whatever the code is supposed to do.

1. The simplest approach is to replace the left < and right > brackets encompassing the code with the corresponding HTML characters for the brackets although this might get tedious if you have a lot of code to show.

2. If you are running wordpress you can simply install a plugin for this instead. This will give you more flexibility. I recommend the “Qoate Simple Code Snippets” plugin. Simply search for it through your wordpress plugin interface.

Capital and small letters

This is easily done with css.

Capital letters inline

test -> TEST

Small letters inline

Test -> test

Capital letters stylesheet class

.capital {
text-transform: uppercase;
}

Small letters stylesheet class

.small {
text-transform: lowercase;
}

Margin and padding

Margin increases the distance between the border of your current object and other objects. Padding increases the distance between content and border within your current object. Both parameters are easily configured via css.

margin: top right bottom left

padding: top right bottom left