簡體   English   中英

如何使響應式導航菜單保留在頁面頂部?

[英]How to make a responsive navigation menu remain at the top of a page?

我現在正在使用響應式導航菜單,以便我的頁面將與不同的平台兼容。 我在這里按照以下步驟操作: http : //www.w3schools.com/howto/howto_js_topnav.asp/,但是當我縮小窗口時,我無法使其保持在相同的位置(我將菜單始終保持在頂部頁面在寬屏上)。 如何使其保持在每個導航欄所指的頂部?

您可能必須在導航欄中添加位置:

position: fixed; /* if you want it to stay there even when scrolling */
position: absolute; /* if you just want it at the top of the page, but not at the top of your browser window */
top: 0;
left: 0;
right: 0; 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM