I want to make a line in the middle of a div. In the following image, the line should be in the middle of the red squares.

I am trying to do this using line height but cannot.
Here is the code:
HTML / CSS:
.wrap { text-align: center; margin: 20px; } .links { padding: 0 10px; border-top: 1px solid #000; height: 1px; line-height: 0.1em; } .dot { width: 20px; height: 20px; background: red; float: left; margin-right: 150px; position: relative; top: -10px; }
<div class="wrap"> <div class="links"> <div class="dot"></div> <div class="dot"></div> <div class="dot"></div> </div> </div>
Demo: https://jsfiddle.net/nkq468xg/
source share