This should be easy points as I forgot how and can't find it on Google.
How do I accomplish something like this:
Blah Blah Blah some code
Blah Blah
in wordpress? pre
doesn't work as it will give a line break.
<pre>: The Preformatted Text element. The <pre> HTML element represents preformatted text which is to be presented exactly as written in the HTML file. The text is typically rendered using a non-proportional, or monospaced, font. Whitespace inside this element is displayed as written.
HTML pre element is an inline element.
Inline links are a design pattern that uses hyperlinked words—conventionally blue, underlined words—to guide users to another page containing related information. Designers employ inline links so that the information linked from the highlighted words does not clutter the user's current webpage.
The <pre> tag defines preformatted text. Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces and line breaks. The text will be displayed exactly as written in the HTML source code.
It may be better to use <code>
than <pre>
to display inline code, for two reasons:
<code>
are a much better match than <pre>
But definitely use CSS classes (as @Blender points out).
There's a caveat: <code>
doesn't escape <>
brackets, so if you want to display HTML then you have to manually escape brackets as <
and >
. (which you should really do anyway; tags in HTML really should be clearly distinguished from data)
<tt>text</tt> gives text
Wait... Wordpress? What HTML tags does it support?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With