#Problem Centering an Image on "Hometown" Project

5 messages · Page 1 of 1 (latest)

crisp burrow
modest stratus
#

The reason the images are off center is because you are using margin-left: 85px; in your image class. What you are doing is basically adding 85 pixels of space on the left of all images causing them to shift to the left awkwardly. If you want them to be in the center you should use

margin-left: auto;
margin-right:auto;```
alternatively you could use the shorthand
```margin: 0 auto;```
crisp burrow
#

THank you so much! I just implemented your advice and now it looks much neater!

sinful mango
#

If you want to get real fancy you can move your hero image from your HTML into your CSS and set that as the background image for the hero div.

background-image: url(images/Atlanta-ga.jpeg);

This way you can have the image take up the entire container.