0

I'm using below code it is throwing the <pre> outside the <p>. So, is there any way to insert <pre> inside <p>. below I'm attaching my code.

<!DOCTYPE html>
<html>
 <head>
    <title></title>
 </head>
 <body>
    <p>
      <pre>
        dkjaskldjasklda
        skladjasklda
      </pre>
   </p>
</body>
</html>
Satya Pendem
  • 307
  • 5
  • 13

1 Answers1

1

<pre> is a block-level element and <p> is not. It's not possible to put block-level elements inside <p>.

If you use the <p> for creating whitespace, you can solve this by adding a margin-bottom to the <pre> tag.

Simmetric
  • 1,443
  • 2
  • 12
  • 20