+ 3

How do we write blocks of code with the code tag?

Learning

12th Oct 2018, 10:11 AM
Norbert Oketch
Norbert Oketch - avatar
2 Respostas
0
<code>A piece of computer code</code> It's basically for formatting, so I wouldn't overthink it.
12th Oct 2018, 1:07 PM
Janning⭐
Janning⭐ - avatar
0
pre preserves spaces and line breaks. it's not that different from the code tag, except that if you use the code tag, it's supposed to indicate that the element contains code (assigns semantic meaning), while pre is just for formatting (no special meaning). https://www.w3schools.com/tags/tag_pre.asp You can compare the "Default CSS Settings" for each.
14th Oct 2018, 2:04 AM
Janning⭐
Janning⭐ - avatar