Use of <pre> and <code> Tags

I understand what the <pre> and <code> tags do.
However, I have the following questions:

  1. When should I use the <pre> and <code> tags?
  2. Is it a good practice to place the <code> tag inside the <pre> tag?

I think you might find your answer in the documentation.
MDN Web Docs (mozilla.org)

There are accessibility issues with pre mentioned, but it does suggest to use pre and code together for multiple lines of code

1 Like

Thank you. :smiley:

That was helpful.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.