Code display in WordPress


I have accustomed in using <code></code> tags in my posts so that many posts have those tags.
Unfortunately , my WordPress theme in its default settings does not really distinguish code in <code></code> tags enough to be easily distinguishable from the rest of the text.
Fortunately Suffusion has place ,Back-end->Custom Includes, for adding custom CSS so adding a bit of CSS there helps a lot.

code {
        background-color: #F9F9F9;
        display: inline-block;
        overflow: hidden;
        border: 1px solid #c0c0c0;
        padding-left: 7px;
        padding-right: 7px;
        border-radius: 5px;
}

While I like what does for a longer bits of code I still like using <code></code> for one liners or for code snippets that are not nicely highlighted.

code
works like this now.

Leave a comment

Your email address will not be published. Required fields are marked *