This article will introduce to you how to directly display html code in html. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Baidu has listed a lot of practices, and I feel that many of them have not been tested before making nonsense. I will summarize them here.
Baidu refers to the <code><code> and <code><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"></pre><div class="contentsignin">Copy after login</div></div> tags. My test results are as follows:
1.<code>
<code> <h1>hello</h1> <h2>hello</h2> <h3>hello</h3> <h4>hello</h4> <h5>hello</h5> <h6>hello</h6> </code>
Rendering:
The code is still rendered and fails. It is said that inline elements are rendered, but they are still rendered if they are changed to span.
2. Rendering: 3. Code: Rendering: Display directly And the format is preserved! feasible! Recommended learning: html video tutorial The above is the detailed content of How to display html code directly in html. For more information, please follow other related articles on the PHP Chinese website!</strong></p><p>Code: </p><pre class="brush:js;toolbar:false;"><pre class="brush:php;toolbar:false">
<h1>hello</h1>
<h2>hello</h2>
<h3>hello</h3>
<h4>hello</h4>
<h5>hello</h5>
<h6>hello</h6>
Same as above render. <xmp>
<h1>hello</h1>
<h2>hello</h2>
<h3>hello</h3>
<h4>hello</h4>
<h5>hello</h5>
<h6>hello</h6>
</xmp>