Need help making code snippet/block
Hello!
I want to include multiple lines of code in a block. I tried using <pre>
which did make a block, but the text was going outside of that for some reason. I also tried nesting paragraphs under my <code>
tag but it also looked silly.
Of course, I can make a <div>
instead of an actual code snippet, but I would prefer not to if possible! I didn’t style the <div>
in this snippet by the way .
(Also, this comes from freecodecamp’s table tutorial )
My Code
<section class="main-section" id="Table_Syntax">
<header>Table Syntax</header>
<div class="code-block">
<code><table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
</tr>
<tr>
<td>Cell 4</td>
<td>Cell 5</td>
<td>Cell 6</td>
</tr>
</table>
</code>
</div>
</section>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Challenge: Technical Documentation Page - Build a Technical Documentation Page
Link to the challenge: