title: How to add a .hover effect to a div?
body: <p>I am pretty new to programming but I cant seem to add an <code>.hover</code> effect using <strong>jquery</strong>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $('.mainr').hover(
      function() {
        $(this).addClass('.mainh')
      },
      function() {
        $(this).removeClass('mainh')
      });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.main {
    position: absolute;
    left: 20%;
    width: 60%;
    height: 500px;
    background-color: #D8D8D8;
    color: #ffffff;
  }
  .mainr {
    position: absolute;
    left: 0px;
    top: 50%;
    width: 23%;
    height: 50%;
    border-radius: 50%;
    background-color: #0B0B3B;
    float: left;
    color: #D8D8D8;
    text-align: center;
    vertical-align: 50%;
    font: 20px"Interstate", "Lucida Grande", Arial;
  }
  .mainh {
    position: absolute;
    left: 0%;
    top: 50%;
    width: 23%;
    height: 50%;
    border-radius: 50%;
    background-color: #D8D8D8;
    float: left;
    color: #0B0B3B;
    text-align: center;
    vertical-align: 50%;
    font: 20px"Interstate", "Lucida Grande", Arial;
  }</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;div class="main"&gt;
    &lt;div class="mainr"&gt;Register&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and could you also tell mehow to center the text inside the div (setting the height)</p>
  
  <p>Thanks,</p>