vendredi 31 juillet 2015

How do I have code in a block in HTML while not having to remove all indentation in my HTML?

I have the following HTML:

<body>
    Here is some code:

    <pre><code>
        Here is some fun code!    
    </code></pre>
</body>

But when I preview it, because the code is indented, the pre is all out of whack. I can fix that by bringing the contents back against the indent, but it looks silly. Can I make that above text look non-indented?

Here's a fiddle: http://ift.tt/1MzjCUu

Aucun commentaire:

Enregistrer un commentaire