Please help | Sololearn: Learn to code for FREE!

+25

Please help

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

1/16/2022 5:02:25 AM

🌍🌎🌏ᴀɪᴍ🌍🌎🌏

12 Answers

New Answer

+15

https://code.sololearn.com/W4gM2hOVOmD9/

+2

Innocent Masuku https://www.w3schools.com/cssref/css_units.asp https://webflow.com/blog/how-and-why-to-use-vh-and-vw-in-webflow

+2

Height takes vh value not vw Like height : 100vh;

+1

Can someone explain why we have vw on a height attribute like this: >> .container_1{ width:100%; height:140vw; I failed to understand.

+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 🌟

+1

Just like they said Viewport height height : 100vh; In the css snippet

+1

This is your solution i think : https://code.sololearn.com/WeZnNNsfffo2/?ref=app

+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:

0

https://akhandcrypto.blogspot.com/2022/01/blockchain-vs-database-hindi.html

0

Check this code output

0

You are changing "nav" class name. You have to change the body class name .And use add and remove instead of toggle.

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