I have the following HTML code with me:
<div class="_idGenObjectLayout-3">
<div id="_idContainer063" class="Code-Box">
<p class="Code">$.ajax({</p>
<p class="Code"> type: “GET”,</p>
<p class="Code"> url: “/myurl”,</p>
<p class="Code"> dataType: “json” // text, html, xml</p>
<p class="Code">})</p>
</div>
</div>
Can I use CSS to automatically wrap all div with class='Code-box' in a <pre>
tag?
Expected Output:
<div class="_idGenObjectLayout-3">
<pre><div id="_idContainer063" class="Code-Box">
<p class="Code">$.ajax({</p>
<p class="Code"> type: “GET”,</p>
<p class="Code"> url: “/myurl”,</p>
<p class="Code"> dataType: “json” // text, html, xml</p>
<p class="Code">})</p>
</div></pre>
</div>
Also I want no space between the lines of all para inside a div with class='Code-box'.
How can I achieve the two requirements?