Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialIvan Tomicic
3,873 Points100% screen size problem
Can somebody tell me what is the problem here?
I have THIS file. with css:
.mainpanel {
background-color: blue;
min-height: 500px;
width: 100%;
height: 100%;
}
.secondpanel {
background-color: red;
width: 100%;
height: 100%;
min-height: 500px;
}
But page always show min-height and does not span 100% height?
Thank you
3 Answers
Travis Joyner
14,553 PointsThe height of a block element corresponds to its content, unless you specify a certain height. Giving this element a percentage height won't really do anything unless the parent element has a specified height.
Travis Joyner
14,553 PointsYou might try setting your div like this:
div {
height:100vh;
}
This will set the div to 100% of the viewport.
Ivan Tomicic
3,873 PointsThanks :)
Ivan Tomicic
3,873 PointsIvan Tomicic
3,873 PointsI want to create something like this website: http://www.diehlgroup.com/ so that it detects screensize and give me fullscreen slideshow, isn't that possible?