By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,730 Members | 1,540 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,730 IT Pros & Developers. It's quick & easy.

How do I center a image in CSS?

P: 1
How do I center an image in CSS?

I tried adding: align:center but that did not work
it's an image wrapped by a div.

Expand|Select|Wrap|Line Numbers
  1. <div style="align:center">
  2. <img src=".."/>
  3. </div>
Apr 5 '12 #1
Share this Question
Share on Google+
2 Replies

P: 1,059
This is interesting. div css dont have any align. but you can use tag align.

follow the link. here is some suggestion
Apr 12 '12 #2

P: 93
<div style="text-align:center"><img src=""></div>


<div><img src="" align="center"></div>


<div><center><img src=""></center></div>
Apr 16 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.