Easy WordPress Style Changes - The PRE Tag
In ABTheme, you can easily change styles by editing the style.css file in the /wp-content/themes/abtheme4/ directory - but you don’t need to.
For example, by default the <PRE> style displays a preformatted text area, that is, in a mono font (Courier) but otherwise similar to any other part of the text.
However, we can add this style code:
<style type="text/css"> pre
{
margin-left:20px;
background:#f0f0f0;
padding:5px;
}
</style>
Which will:
- Indent the left side a bit (margin-left: 20px; or pixels),
- Change the background to a light gray (background:#f0f0f0;),
- And add a bit of padding around it to look nicer (padding:5px;).
And the best part?
You don’t have to edit the theme - instead, go to the ABTheme; Code Insert tab, go down to the the <head> section, and add the code there.
The result? It’s included before each webpage displayed, and the style is used on your blog. Code in that section comes after the other definitions, so it can override them.
And so then the <PRE> section can stands out - for example, I use that on my programming and computer blog Utopia Mechanicus to highlight code better.
And with ABTheme, it’s all done in the Admin section - NO PHP Formatting!