Forums

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

Home Forums CSS Icon nav menu container too large…

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #169910
    opafaf
    Participant

    OK. I have a nav menu created out of icons that is not fitting into its container.
    I am trying to center the nav menu on the page. When I put in what the width of the overall div is supposed to be (840px), I get this: http://imgur.com/bYEtLry
    It bumps the last icon down to the next level.

    So, I gradually make the box wider to accommodate for that and I get this: http://imgur.com/MIZxG7N

    I put the tomato color in the BG so you can see what it is doing. It has like 40px of extra space on the left which makes it so the icon menu is not centered on the page.. It is odd and I have no idea what I am doing wrong.
    Here is the div CSS:
    #iconnav {
    background-color: #F66;
    height: 184px;
    margin: 0 auto;
    width: 840px;
    display:block;
    }

    I can change it to “display:inline” and that will remove the extra space, but then it doesn’t center on the page.. any ideas?

    #169912
    Paulie_D
    Member

    We’d really need to see the HTML & CSS in action.

    Could you make a Codepen.io reduced case example?

    #169913
    opafaf
    Participant
    #169916
    Paulie_D
    Member

    As you can see…nope.

    #169923
    Paulie_D
    Member

    …and allowed for whitespace?

    #169931
    opafaf
    Participant
    #169933
    opafaf
    Participant

    I actually figured it out..
    I added this to it:

    • {
      margin:0;
      padding:0;
      }

    it worked.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.