Viewing 1 replies (of 1 total)
  • If there is no other element within the div, you can remove this. Also, the align attribute is deprecated, meaning it’s unsupported in HTML 4.01 Strict / XHTML 1.0 Strict.

    Use CSS instead

    Try <img src=”…” style=”margin: 0 auto; display: block;” />

    If you have a separate stylesheet, you can apply an ID or class to the img and place the styles in the stylesheet. For instance:

    header.php: <img src=”…” class=”center-element” />
    stylesheet: .center-element{ margin: 0 auto; display: block; }

    For more information on the margin and display properties, please reference w3schools.com

Viewing 1 replies (of 1 total)
  • The topic ‘Having Trouble Centering and image’ is closed to new replies.