i am newbie in canvas and svg. I want to make a canvas or svg line between to specific coordinates
For example i have two rectangles and i have to make a line between them (In this case i have to make this line center of two rectangles)

what i've tried: SVG codes like this:
HTML:
<svg version="1.1" id="line_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100%" height="15px" xml:space="preserve">
<path class="path2" fill="#01a09e" stroke-width="5" stroke="#01a09e" d="M0 0 l890 0"/>
</svg>
CSS:
.path2 {
stroke-dasharray: 1120;
/* stroke-dashoffset: 800; */
animation: draw1 5s linear alternate;
}
@keyframes draw1 {
from {
stroke-dashoffset: 1120;
}
to {
stroke-dashoffset: 2240;
}
}