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 trial

WordPress From Bootstrap to WordPress Create Bootstrap Styled Theme Templates Creating a Portfolio Landing Page

Alexander Ulbashev
Alexander Ulbashev
10,130 Points

Hello! I don't understand why do you use this trick for featured image. Why are you not using CSS for img(heigth: auto)

Why do you use variables rather than add one simple rule in CSS ? item img { width: 100%; height: auto; }

You're correct. You can just add height: auto to make the image responsive.

1 Answer

Nicole Carvalho
Nicole Carvalho
8,416 Points

I agree with you. Here's my css:

.portfolio-piece { text-align: center; }

@media (min-width:768px) {

.portfolio-piece img {
 max-width: 100%;
 height: auto;


The images look much better on a smaller screen width and the code is less complex. Hope this is a good alternative than what they discussed in the video.

Motoki Higa
Motoki Higa
14,111 Points

Should mark as best answer ay! Thanks for sharing