Background position Moves with width change

Im trying to change the width of my white background that is behind my image. But for some reason when I change the width it moves the whole thing to the left. How do I change the size of the background color without moving it to the left

Edit: I solved it by changing the margin instead

1 Like

FIRST: Try fixing this:

The # is missing from the id #img in the CSS:
Screenshot 2022-03-21 7.02.59 AM



SECOND:
Iā€™m seeing the image breaking out of the box to the right.

Screenshot 2022-03-21 7.02.43 AM

This can be corrected by:

  • fixing the missing #
  • Adding a relative width:
    Like adding a max-width: 100%;
    and removing the height:400px.

Screenshot 2022-03-21 7.22.32 AM

#img {
  border-radius: 50%;
  border-style: solid;
  border-width: 3px;
  max-width:100%;
}



SO, WE END UP WITH THIS:
Screenshot 2022-03-21 7.04.10 AM

1 Like

Thank you! That really helped my 'img 'fill out nice.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.