Center image
KamronGorney (0)

Can you tell me how to center an image i've been trying for hours and i still can't find out how to can someone please help me with my troubles

You are viewing a single comment. View All
PYer (2389)

set the margins to auto and the display to block then add it as a class to the image element.

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;

then do <img src="image.jpg" alt="image" class="center">
Please mark this comment as the answer