0

I have put the body of my page in a container. I then put my images in a div and gave them the class 'grid_12' and id 'gallery'. Here is the CSS i wrote for that id.

#gallery img{

border: 8px solid;
color: #0000FF;
margin: 0 0 20px 0;

}

What code do i need to center the images? I've already unsuccessfully tried floating-center/text-align-center.

user3001774
  • 19
  • 1
  • 1
  • 3

2 Answers2

0

use this:

img.center {
display: block;
margin-left: auto;
margin-right: auto;

}

from here

Community
  • 1
  • 1
Mert
  • 1,333
  • 1
  • 12
  • 15
0

First you need to give the size of div (width and height) then try your css code...

vino20
  • 429
  • 4
  • 13