+ 4

How to place an image in center?

I tried to use align="center" but it is not working i can't place my image into center it can be placed only at either left or right. please help me in solving this!!! https://code.sololearn.com/WDQhAC36EBDl/?ref=app

24th Jan 2018, 5:42 AM
BARBIE ZAVERI
BARBIE ZAVERI - avatar
3 Answers
+ 8
/*Add this code to your CSS*/ img{ display:block; margin:auto; }
24th Jan 2018, 5:47 AM
Tran Huu Dang
Tran Huu Dang - avatar
+ 8
align is not working in <img> tag. As I remember align just works with block element , table.
24th Jan 2018, 5:48 AM
Tran Huu Dang
Tran Huu Dang - avatar
+ 2
no align works with <img> but problem is that we can place an image at right or left with it... And Thank you for help 😄
25th Jan 2018, 4:27 PM
BARBIE ZAVERI
BARBIE ZAVERI - avatar