Need to get an image in the header centered | XM Community
Skip to main content
Solved

Need to get an image in the header centered


Forum|alt.badge.img+5
Would anyone be willing to share some code with me for centering an image within the header? I am inexperienced with coding and in the past I have gotten around this issue by centering a table and placing the image within the table. That no longer seems to be compatible with mobile devices so I am in need of a new way to center an image in the header. Any help would be greatly appreciated! - David

Best answer by TomG

There are several ways to do this, but this is probably the simplest: ``` <div style="text-align: center;"><img alt="alt_text_here" src="image_url_here" style="max-width:100%;margin:auto;"></div> ```
View original

3 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5938 replies
  • Answer
  • July 10, 2018
There are several ways to do this, but this is probably the simplest: ``` <div style="text-align: center;"><img alt="alt_text_here" src="image_url_here" style="max-width:100%;margin:auto;"></div> ```

Forum|alt.badge.img+5
  • Author
  • Level 3 ●●●
  • 204 replies
  • July 11, 2018
Much appreciated. Thank you @TomG

  • 2 replies
  • September 4, 2019
is there a NON code way to do it for those of us who dont understand either the code or where/how to use it?

Leave a Reply