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!
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 trial

Graham Davidson
Courses Plus Student 14,966 PointsImg 100% height
Morning All
I want to create a full height image of a Div - I am using 100% height on html and body etc and this creates 100% height of the viewport but what I am looking for is 100% height of the browser window. As if I open the attached site with Dev tools open it all goes a bit wrong.
2 Answers

Dmitriy Simberev
926 PointsMay be... .colTwo img { width: auto; height: 100%; background-size: cover; }

Michael Trilford
7,232 Points.colTwo { background: url('img/mainImage.jpg') 0 0 no-repeat; background-size: cover; }
This is the easiest solution I think.
Michael Trilford
7,232 PointsMichael Trilford
7,232 PointsPretty sure it has to be a background image for that to work.