#height 100% not working

8 messages · Page 1 of 1 (latest)

west lynx
#

first of all i wonna say i did google for like half an hour and tried what i found but nothing seems to work. is you can see in the code the different colors(that appear once you press the button) are supposed to stretch full height but are just stuck at the top for some reason, very confusing.
only thing that actually changed the height was "height: 88vh;", but there has to be a more sensible way to set the height?
(also there are borders where there shouldnt be, i thought i was done with css, guess not xD)
thanks in advanced!

code: https://scrimba.com/scrim/co0a54263925dc57521bfdba1

Scrimba

Learn to code with interactive scrims. Our courses and tutorials will teach you React, Vue, Angular, JavaScript, HTML, CSS, and more. Scrimba is the fun and easy way to learn web development.

blissful holly
#

Hey @west lynx ,
Nice job so far!
remember that a percentage always refers to the parent. In this case, you're telling that .color-container div to be height: 100% of its parent. But what is the parent? Does it have a height? If that's not relevant, then you can use a value in px/em/vh etc instead.

west lynx
blissful holly
#

So, if it doesn;t make sense on the parent, set a height on the .color-container

west lynx
west lynx
blissful holly
#

note that copy to clipbaord won't work on scrimba because of the mini-browser's limitations. have to test on local environment.