+ 25

Please help

Why nav background-color not change on scroll 🤔😑 https://code.sololearn.com/WO5qgwQoY8Sg/?ref=app

16th Jan 2022, 5:02 AM
🌍🌎🌏AIM🌏🌎🌍(Inactive)
🌍🌎🌏AIM🌏🌎🌍(Inactive) - avatar
12 Answers
+ 15
https://code.sololearn.com/W4gM2hOVOmD9/
16th Jan 2022, 5:30 AM
★ Zazzle ★
★ Zazzle ★ - avatar
+ 2
Height takes vh value not vw Like height : 100vh;
17th Jan 2022, 11:10 AM
Ismail Khosrowshiri
Ismail Khosrowshiri - avatar
+ 1
Can someone explain why we have vw on a height attribute like this: >> .container_1{ width:100%; height:140vw; I failed to understand.
16th Jan 2022, 10:05 AM
Innocent Masuku
Innocent Masuku - avatar
+ 1
body{ background-color:black; height:100vh; } .container_1{ width:100%; height:150vw; You've to edit this field of you code and It will be good 🌟
17th Jan 2022, 7:48 AM
Nasr Aldeen Alhadi
Nasr Aldeen Alhadi - avatar
+ 1
Just like they said Viewport height height : 100vh; In the css snippet
17th Jan 2022, 11:35 AM
Eneghalu Kosisochukwu
Eneghalu Kosisochukwu - avatar
+ 1
This is your solution i think : https://code.sololearn.com/WeZnNNsfffo2/?ref=app
17th Jan 2022, 3:09 PM
DNS
DNS - avatar
+ 1
You declare height in vw which is wrong and not declare the height of the nav and nav . Sticky must be .sticky only and in the sticky class background property must bhi background-color:
17th Jan 2022, 3:11 PM
Rahul
Rahul - avatar
0
Check this code output
17th Jan 2022, 3:10 PM
DNS
DNS - avatar
0
You are changing "nav" class name. You have to change the body class name .And use add and remove instead of toggle.
17th Jan 2022, 5:59 PM
Hamid Reza Sadati
Hamid Reza Sadati - avatar
0
css selector is wrong, it must be nav.sticky and you changed position of the images to absolute so nav height become 0 therefore you are not able to see the change
17th Jan 2022, 6:46 PM
Ranjit Kumar
Ranjit Kumar - avatar