Draw a line in a div

Its working for me

 .line{
width: 112px;
height: 47px;
border-bottom: 1px solid black;
position: absolute;
}
<div class="line"></div>

$('.line').click(function() {
  $(this).toggleClass('red');
});
.line {
  border: 0;
  background-color: #000;
  height: 3px;
  cursor: pointer;
}
.red {
  background-color: red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<hr class="line"></hr>
<p>click the line</p>

No need for css, you can just use the HR tag from HTML

<hr />

Tags:

Html

Css