Home > database >  Change relative to absolute via media query
Change relative to absolute via media query

Time:11-27

Is it possible to have a page that opens with 6 box items as nav menu, but when one is clicked to go to that area on the page, the nav becomes a standard fixed nav bar at the top of the page? Using only CSS (no JS).

  • I am a VERY junior coder.

I have been unable to find this to be possible thus far.

CodePudding user response:

Everytime a link or a tab in the nav is clicked,a new webpage is reloaded. New webpage means a new html file and create a new css file to link with it according to the design u want there, yes doing position absolute and top 0; will solve the problem there to stick the navbar position at top.

I hope this helps, please feel free to ask me further !!

CodePudding user response:

you can use id and callback(#) that id as a link

<div > 
    <ul><a href="#page1"> page 1 </a></ul>
    <ul><a href="#page3"> page 3 </a> </ul> 
</div>
<h2 id="page1">this is page 1</h2>
<h2 id="page3">this is page 3</h2>
  • Related