Why does the viewport jump away when clicking on link?

Hello,

I’ve got almost until the end of the current challenge, Tech Docu Page.
Still, there is a problem, that didn’t occur until now.

When I click on a link the viewport jumps away from the alignment of the nav menu and the content. Meaning the menu covers the main content.
If there is no action it is all right. It is wierd.
Can you help, please?

Codepen

I think it does this because it is supposed to lead to the div you’re selecting in your link. The problem here is that your site is overflowing the x-axis so you have a scroll at the bottom of the page. Try modifying your code so the contents don’t go out of the viewport

I made a mistake, when I modified the following code:

#main-doc,
#main-section {
  width: 100%;
  margin: 0 0 0 240px;
}

There shoudn’t be #main-section tag inside it and the width: 100%; must be set to a fixed number number, but this only a hunch just yet.

So the main thing I screwed up is adding #main-section to the css code.

EDIT: Actually, I don’t need the width for the #main-doc id, also I use that property in the @media query anyway.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.