56

I tried to put some HTML snippets into my README.md on Github but the HTML codes are parsed.

How do I do it?

<h2>Example of code</h2>

<pre>
    <div class="container">
        <div class="block two first">
            <h2>Your title</h2>
            <div class="wrap">
                //Your content
            </div>
        </div>
    </div>
</pre>
4

1 回答 1

104

尝试将您的 HTML 片段放在这样的```HTML块中:

```html
<h2>Example of code</h2>

<pre>
    <div class="container">
        <div class="block two first">
            <h2>Your title</h2>
            <div class="wrap">
            //Your content
            </div>
        </div>
    </div>
</pre>
```
于 2013-05-03T06:33:14.470 回答