Give help. Get help.

  • # February 8, 2018 at 2:32 pm

    I’m want to define top navigation bar as FIXED and the content below as RELATIVE, i mean that i want the page content position below the navigation bar, but in my code result the content is going on the navigation bar, there is a good way to fix it?

    I don’t want to use margin-top: 100px… i want the content position go below the navigation auto, and not by pixels

    # February 8, 2018 at 11:58 pm

    Practically Not possible. Since Position:fixed makes your navigation out of flow from the body. so the other RELATIVE parts of your HTML did not know there is such navigation available. so there is no way to do that. you can set Margin to your MAIN Content and Top:0 for your fixed nav.

    By the way may i know the reason for this auto positioning idea ?

    # February 9, 2018 at 12:19 am

    The options are to have a fixed height top bar and adjust the margin/padding of the content accordingly


    Use Javascript to obtain the height of the top bar and adjust the CSS accordingly

    # February 9, 2018 at 12:47 am

    thanks on the explain yoyo.
    I added margin to the DIV content, but now it’s margin also the navigation bar

    # February 9, 2018 at 1:13 am

    As already mentioned you have to add top:0; for your ul to fix it on top.


Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.