#Problem Centering an Image on "Hometown" Project
5 messages · Page 1 of 1 (latest)
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;```
THank you so much! I just implemented your advice and now it looks much neater!
looks good
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.