Horje

Example of HTML <code> For Computer Code Part - 2

To fix this, you can put the <code> element inside a <pre> element:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<p>The code element does not preserve whitespace and line-breaks.</p>
<p>To fix this, you can put the code element inside a pre element:</p>

<pre>
<code>
x = 5;
y = 6;
z = x + y;
</code>
</pre>

</body>
</html>

Output should be:

Example of HTML <code> For Computer Code Part - 2



Single Articles
Example of HTML <code> For Computer Code Part - 2HTML Computer Code


Related Articles
What is HTML Computer Code HTML Computer Code
How to create HTML <kbd> For Keyboard Input HTML Computer Code
How to create HTML <samp> For Program Output HTML Computer Code
How to create HTML <code> For Computer Code HTML Computer Code
How to create HTML <code> For Computer Code Part - 2 HTML Computer Code
How to create HTML <var> For Variables HTML Computer Code

Type:
Html
Category:
Web Tutorial
Sub Category:
HTML Computer Code
Uploaded by:
Admin



Share on: