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

CSS

Alita Edmonds
Alita Edmonds
6,068 Points

How can I resize my image?

Which property would I use for making an image small? And is there a property for making that image round? Thank you!

1 Answer

Steven Parker
Steven Parker
231,261 Points

You can generally size an image just by setting the "width" property, and the height will adjust automatically to keep the aspect ratio.

You can round the corners by setting the "border-radius" property. If the image is square, you can make it a circle with "border-radius: 50%;".

Alita Edmonds
Alita Edmonds
6,068 Points

Thanks! How can I center the image?

Steven Parker
Steven Parker
231,261 Points

The best method may depend on the circumstances, but one basic way would be to set "display: block;" along with "margin: auto;"

It sounds like you might enjoy and benefit from the CSS Basics and CSS Layout Basics courses.

Alita Edmonds
Alita Edmonds
6,068 Points

Thank you so much! I have taken those courses before but I think that I might need a refresher.