title: Create ruler point in cm like input range
body: <p>I want to create a ruler, but a multiple point ruler, like in office words.</p>
  
  <p>How do I create a min and max in cm or inches, help me with an idea or code.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.x').draggable({
      axis: 'x',
      containment: 'parent',
      start: function() {
          var top = ($(this).offset().top + 5) + 'px';
          var left = ($(this).offset().left + 5) + 'px';
          $('#parent').append('&lt;div id="line" style="left:' + left + ';top:' + top + ';"&gt;&lt;/div&gt;');
      },
      drag: function() {
          $('div#line').css({
              'top': ($(this).offset().top + 5) + 'px',
              'left': ($(this).offset().left + 5) + 'px',
          });
      },
      stop: function() {
          $('div#line').remove();
      }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>* {
      margin: 0;
      padding: 0;
  }
  
  html,
  body {
      width: 100%;
      height: 100%;
      background: #aaa;
      padding: 10px;
      box-sizing: border-box;
  }
  
  #parent {
      width: 100%;
      height: 2px;
      box-sizing: border-box;
      display: inline-block;
      background: #eee;
  }
  
  #point {
      padding: 0;
      background: red;
      display: inline-block;
      cursor: pointer;
      user-select: none;
      height: 10px;
      width: 10px;
      position: absolute;
      margin-top: -5px;
      margin-left: -5px;
  }
  
  #point:before {
      position: absolute;
      content: '';
      width: 0;
      height: 0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-top: 5px solid #f00;
      left: 0;
      top: 100%
  }
  
  #line {
      position: fixed;
      width: 1px;
      background: red;
      height: 100%;
      top: 0px;
      opacity: .6;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;div id="parent"&gt;
      &lt;div id="point" class="x"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>