How to center an image using text-align center in HTML? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to center an image using text-align center in HTML?

NickFNickF USAPosts: 132Member

Is it possible to center image using text-align:center; style?

Comments

  • DavidMDavidM USAPosts: 342Member

    It is not supported by W3C.

    Use the following way:

    img.center {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    
Sign In or Register to comment.