Center two images in a div
I have a div like this
<div id="browsers"> <h2>Title</h2> <p>Text recomending the use of either Chrome or Firefox.</p> <a href="http://google.com/chrome/"><img src="img/64-chrome.png" /></a> <a href="http://mozilla.org/firefox/"><img src="img/64-firefox.png" /></a> </div> and CSS
#browsers { margin:0 auto; padding:22px; width:500px; background:white; } and I want to center two images in the middle of the div. I managed to center them with
#browsers img { margin-left:auto; margin-right:auto; display:block; } however, the result is not the one I want, since one image is on top of another. I want them to be on the same line. What is the best or usual way to do this?
+4
2 answers