When we apply position:fixed to an element, it\'s taken out of the normal flow of the document, therefore it doesn\'t respect it\'s parent\'s element width. Are the
position:fixed
Add width:auto; to the element with position:fixed; to make its width equal to the width of its parent element.
width:auto;
position:fixed;