<code> vs. <pre> in WordPress editor

Writing my earlier post about the textarea issue I initially ended up with a funny looking post. It was due to the examples of HTML code included in the post not being parsed properly. Apparently I had been writing my post in HMTL mode instead of Visual mode and all the HTML code was parsed as “real” code.

The code was wrapped in <code> tags, instead of the usual <pre> tags which keeps the code looking as expected.

If you are neither certain of the exact uses of each of these two tags I suggest you read this documentation page for a quick overview of the differences along with other usage hints.

Comments

Leave a Reply

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

Why ask?