when you ask a question about a step of a project, please link to that step, thank you
the div is removed from the flow of the document, so it changes what determines its width. With a position of absolute it doesn’t have a parent element to inherit the width from and it has width of 0.
if we inspect the page and take a look at the element we can see that before setting the position to absolute it has these dimensions
This is after
The thing to keep in mind, is that the colored part, what we see, is the border. And only the bottom one at that.
Le me also link a couple of articles on making shapes with CSS that could help to explain more.