Center image using text-align center
- html img class - The problem is, is there any good way to center an html image tag using css ?
- Is the property text-align: center;of img html5 will work?
- That will not work as the text-align property applies to block containers, not inline elements, and html img is an inline element.
Use this instead in your img html :
try the following solution for img tag
- Another way of doing would be centering an enclosing paragraph.
- text-align: center is a good way to center an html image tag, and did not specify that the property had to be a part of the img tag.
You can do the following solution: text-align: for your html5 img tag
Here the solution is simply for your img tag html. change parent align.
Try this one on parent properties text-align:center