Explanation
The p
DOM Element can only contain inline elements. (MDN) (W3C HTML5)
The start tag is mandatory. The end tag may be omitted if the <p>
element is immediately followed by an <address>
, <article>
, <aside>
, <blockquote>
, <div>
, <dl>
, <fieldset>
, <footer>
, <form>
, <h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, <header>
, <hr>
, <menu>
, <nav>
, <ol>
, <pre>
, <section>
, <table>
, <ul>
or another <p>
element, or if there is no more content in the parent element and the parent element is not an <a>
element.
Permitted tags
Here is an exhaustive list of the permitted tags inside a p
element.
Content:
<abbr>, <audio>, <b>, <bdo>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <datalist>, <dfn>, <em>, <embed>, <i>, <iframe>, <img>, <input>, <kbd>, <keygen>, <label>, <mark>, <math>, <meter>, <noscript>, <object>, <output>, <progress>, <q>, <ruby>, <samp>, <script>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <textarea>, <time>, <var>, <video>, <wbr>
and plain text (not only consisting of white spaces characters).