The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Nav bar causing scrolling
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.
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:
Additionally, you should add the following lines:
You can remove the margin:-10px; on #nav