The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Fixed nav bar and div layout problem

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #173218

    I am really tired of this. I have asked the same question earlier but now I have made some changes and it screwed everthing again.

    1. Fixed div which contains ( name + logo + navigation ) is hiding the content. id=”header”
    2. The div with the id=”three” has four div creating a 2X2 table like layout are not align properly in the center. Whenever I try to change the width to 50% it messed the layout and other divs float below to the other divs.
    3. I am also not abe highlight the default link when the page load for the first time which is “About”.



    This is a JS issue. based on your scrollpoint. I think you need to think in terms of an offset for each. But see comment about box-sizing later on.

    $("html, body").animate( {scrollTop: $(navid).offset().top -220},"slow");

    Unless you use box-sizing:border-box the widths of your elements will be calculated excluding padding/borders.

    So your 50% divs will each be 50%+ 1px wide (which adds up to 100% + 2px and so they don’t fit.

    Be aware that once you’ve set it globally it might mean some minor tweaks here and there…alternatively, you could just set it as an when required. Me, I prefer globally.

    Tweaked version for you.

    I added the box-sizing tweak which reduces the offset by the padding on your header(?) down to 190px.

    You need to look into the various ways of setting a default ‘current’ link class. For small sites you c an do this manually by giving each page a class or ID and setting in the CSS like

    #About.current {

    Or there is JS..


    oh! Pauli_D thanks again :)

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.