Not able to clear two tests.I am astonished to see that there is an error in declaring nav element.The two tests are:-
(3. The navbar should always be at the top of the viewport.)
( 2. The height of the welcome section should be equal to the height of the viewport.)
Also,i have looked upon previous answers but i have not succeeded.Please help me out.
Please post a link so we can see the website, you can use codepen for example.
here it is–https://codepen.io/anon/pen/JePppZ
#2
It is asking you that the #welcome-section
height should be the same as the height of the viewport, the viewport is basically the height of the page per si. You can set its height to be the same as the viewport with height: 100vh
.
1 vh
is 1% of the viewport, thus 100 vh
is the same as the viewport. Read more here: https://www.w3schools.com/cssref/css_units.asp
#3
The #navbar should be always on the top even when we scroll the page, so it should be fixed
in the page.
You can fix it in the page so it doesn’t move when scrolling by using position: fixed
. Since they want the navbar to be fixed at the top, you can give it a value of top: 0
.
i am really grateful for your help but i have tried to fix #navbar position before and still it’s not working.
You’re right, besides of those changes you must also remove the margin on the top.
Let me know what you’ve tried already.
I have tried to fixed the positioning in css and using style attribute to do the same as i have understood from the previous lessons but not succeeded.Is there any other method to clear it then please suggest me.
Now you have a problem in your css but you should pass the tests after you fix it.
Remove those brackets around the #navbar
and try to pass the test again.