Welcome to the Treehouse Community
Looking to learn something new?
Ray KennedyCourses Plus Student 2,982 Points
when using g percentage instead of px, you only need to specify width of the element and not the height?
you only need to have the width in percentage and not the the height for the element to scale properly? be cause in the video he does nothing to the pictures height only the width
If you leave the
height as the default
auto, it will keep the image's correct aspect ratio. Otherwise it will stretch the image based on the percentage of the containing element.
That's correct. The browser will automatically scale the height proportionally for you as the width of your image changes.
ellie adam26,376 Points
When we design for small devices we use % for width. If screen is hundred % we may want picture 50 % or 60 % it depends.