I’m having issues with two points on this project: Content test 13 ( 13. When I click on a navbar element, the page should navigate to the corresponding section of the “main-doc” element (e.g. If I click on a “nav-link” element that contains the text “Hello world”, the page navigates to a element that has that id and contains the corresponding .), which it’s not even clear to me what they want, and the first layout test ( 1. On regular sized devices (laptops, desktops), the element with id=“navbar” should be shown on the left half of the screen. It should always be visible to the user and should remain stationary. You may need to enlarge the viewport or zoom out to ensure the navbar doesn’t scroll with the page content.), which relates to having a fixed-position menu that changes according to view-port size. When I set the menu to “position: fixed;”, it not only doesn’t pass the test but it also ends up eating the body of my page.
You want the 20% when the screen is large, and 100% when the screen is small, but you have 20% for the smaller screens.
When you use position: fixed on an element, that element is no longer “visible” to the other elements. So the rest of the elements will act like the navbar isn’t there, which is why the navbar is eating up space.
You can deal with this by manually adding some margins to the other elements.
I took a look. Combining position: fixed with display: block gives the effect I think they want, but when I implemented display: block on its own, it didn’t check the tests.
Ok, thanks for the information. Any idea what they mean by “13. When I click on a navbar element, the page should navigate to the corresponding section of the “main-doc” element (e.g. If I click on a “nav-link” element that contains the text “Hello world”, the page navigates to a element that has that id and contains the corresponding.” that isn’t already present in the file?