This question already has an answer here:
How does a <pre>
HTML tag differs from <code>
html tag.
I have checked on W3Schools page, it seems they are just the same.
If there any major difference between them ?
This question already has an answer here:
How does a <pre>
HTML tag differs from <code>
html tag.
I have checked on W3Schools page, it seems they are just the same.
If there any major difference between them ?
<pre>
says "The whitespace in this element is important" (so new lines and spaces get rendered as new lines and spaces).<code>
says "This is code".They have nothing in common aside from being HTML elements.
W3Schools is often wrong, often out of date, and often teaches worst practises. If they claim the two elements do the same thing, then that is just another reason to avoid the site.
Don't go to w3schools. Check the w3c documentation for pre and code instead.
PRE:
CODE: