Forums

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

Home Forums CSS Nav bar causing scrolling

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #236806
    ikemikek
    Participant

    Guys, the time has come. I can NOT figure out why my various elements are causing scrolling…Somehow my left-margin must be off somewhere but I can’t figure out where.
    http://codepen.io/ikemikek/pen/adyxYB

    #236810
    bearhead
    Participant

    Its because of this line:

    * {
      border: 1px solid black;
    }
    

    You’re applying a 1px border to every element on the page. All those borders are adding up to push the width of the page beyond 100% of the screen size.

    You should remove that line and apply your borders more judiciously. For elements that have borders, you may also want to consider using:
    box-sizing: border-box;

    Additionally, you should add the following lines:

    body{
      margin:0;
    }
    #nav ul{
      padding:0;
    }
    

    You can remove the margin:-10px; on #nav

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