Jim R Posted October 4, 2011 Share Posted October 4, 2011 Hello, I have my left and right margins set at auto for the img tag in the .home-middle-3 class. The image that doesn't appear to be centered is the Boys Club image. http://grassrootsindiana.com/ Link to comment https://forums.phpfreaks.com/topic/248430-centering-an-image-in-a-div/ Share on other sites More sharing options...
Jim R Posted October 5, 2011 Author Share Posted October 5, 2011 I think I figured it out. It may have been a max-size issue with another image. Link to comment https://forums.phpfreaks.com/topic/248430-centering-an-image-in-a-div/#findComment-1275960 Share on other sites More sharing options...
Frank P Posted October 5, 2011 Share Posted October 5, 2011 I think I figured it out. It may have been a max-size issue with another image. Margin:auto doesn't work on inline elements such as images. In stead, you could use text-align:center, declared for the parent element. For more information, see How to Center in CSS. Link to comment https://forums.phpfreaks.com/topic/248430-centering-an-image-in-a-div/#findComment-1276062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.