I'm trying to create a text changing animation in which four words cycle through a fixed underlined space. I've gotten the text changing piece done using a simple js script, but I'm having trouble positioning the underline. I've tried using hr to no avail and I've gotten close using an inline svg, however I can't figure out how to position the SVG so that it's underneath the text. I've tried adjusting the position in CSS using the SVG id and I've also tried adjusting the position of the SVG directly in the svg code.
var text = ["Repurposed", "Remnant ", "Scrap", "Upcycled "];
var counter = 0;
var elem = $("#greeting");
setInterval(change, 3000);
function change() {
elem.fadeOut(function(){
elem.html(text[counter]);
counter++;
if(counter >= text.length) { counter = 0; }
elem.fadeIn();
});
}
#layer_1 {
display: block;
padding-bottom: 20%;
padding-top: 0;
text-align: right;
margin-left: 40%;
margin-top: 0;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="row">
<div class="col-6">
<div class="text-change" id='greeting'>Upcycled</div>
<div class="liner">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400.52 4.84"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;stroke-width:3px; padding-left: 25%;}</style></defs><line class="cls-1" y1="2.84" x2="200.51" y2="2"/></svg>
</div>
</div>
<div class="col-6">
<div class="text-change-right">Materials</div>
</div>
</div>