Can we push images to center | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can we push images to center

4th Apr 2018, 8:40 AM
Divyashree K.N
Divyashree K.N - avatar
8 Answers
+ 2
Yes but you have to put the image into a container (mostly a div) and set the container's text-align to center: Here's an example: <div style="text-align: center"> <img src="https://www.reddit.com/favicon.ico"></img> </div>
4th Apr 2018, 9:25 AM
Kevin Eldurson
Kevin Eldurson - avatar
+ 1
Or using css, inside a container as Texas said, margin: 0 auto;
4th Apr 2018, 10:35 AM
Bebida Roja
Bebida Roja - avatar
0
can put align attribute and than place img into center
4th Apr 2018, 10:36 AM
Anant Chaudhary
0
any one
4th Apr 2018, 10:39 AM
Anant Chaudhary
0
Anant Chaudhary Not anymore in HTML5.
4th Apr 2018, 10:40 AM
Kevin Eldurson
Kevin Eldurson - avatar
0
so we can not
4th Apr 2018, 10:53 AM
Anant Chaudhary
0
Not with the align attribute.
4th Apr 2018, 11:20 AM
Kevin Eldurson
Kevin Eldurson - avatar
0
so how can we
5th Apr 2018, 6:46 AM
Anant Chaudhary