Is it possible to keep the width of the parent element when position: fixed is applied?

前端 未结 8 1936
没有蜡笔的小新
没有蜡笔的小新 2021-02-01 12:16

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

8条回答
  •  旧巷少年郎
    2021-02-01 12:51

    A workaround might be: left:8px; right:0; width:18%; in the CSS for the nav. Not the best solution though.

提交回复
热议问题