Drupal website specialists. Call us about your project on (02) 8006 3402

img image align css center

Posted 16/March/2010 by neubreed

After reading this you'll be able to center-align an image within a div using CSS (without the cross-browser headaches that margins and padding can cause).

First and foremost, check that you're using the correct doctype. We found that using the following doctype worked a treat across all browsers in this case.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">