html css snippets code example

Example 1: Display HTML snippets in HTML

/* 1. First search "html entities converter" in Google
and convert the code snippet in html entities form */
2. /* Paste the code inside this snippet : */
<pre>
  <code>
  
   &lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Page Title&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;My First Heading&lt;/h1&gt;
&lt;p&gt;My first paragraph.&lt;/p&gt;
  
</code>
</pre>

Example 2: html insert html snippets

<head>
  <link rel="import" href="/path/to/imports/stuff.html">
</head>

Example 3: html insert html snippets

$(function () {
  var includes = $('[data-include]')
  $.each(includes, function () {
    var file = 'views/' + $(this).data('include') + '.html'
    $(this).load(file)
  })
})

Tags:

Html Example