<div class="block"></div>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.block{
--blockOffset: 33vw;
position: relative;
left: var(--blockOffset);
width: 300px;
height: 50px;
background-color: red;
}
.block::after{
content: '';
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 5px;
width: calc(100vw - var(--blockOffset));
background-color: green;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.