title: How to show div on input focus in css?
body: <p>I have a input and a div whose height and width is equal to border bottom of input. I just want to show div which is firstly hidden.</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-css lang-css prettyprint-override"><code>.cool{
    font-size: 30px;
    margin: auto;
    outline: none;
    padding-bottom: 0.2em;
    border-width: 0px 0px 2px 0px;
    border-bottom-color: black;
  }
  div.bar{
    width: 365.3px;
    height: 2px;
    background-color: #42c0fb;
    position: relative;
    top: -2px;
    display: none;
  }
  input:focus .bar{
    display: block
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div style = "margin: auto;"&gt;
    &lt;input class = "cool" type = "text" /&gt;
    &lt;div class = "bar"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Please help. The above code doesn't work.</p>