How can we bring image in center in html without using css? | Sololearn: Learn to code for FREE!

+1

How can we bring image in center in html without using css?

In the search results it showed that align="middle" attribute can be used, but its not working.

8/14/2019 3:01:05 PM

Shraddha Gupta

3 Answers

New Answer

+5

You could use the deprecated <center> tag but the reason why CSS did not work is because of the parent's size.

+5

this is the hard way using unicode spacing as far as an actual CSS inline use a <div align='center'> img here </div> keep in mind that <center> tag is depreciated https://code.sololearn.com/WQB955UV1aRA/?ref=app

+2

The align attribute of <img> is obsolete and not supported in HTML5. You should definitely use CSS.