How can I add a URL link to an image?

Hi everyone,

How can I add a url link to an image?

I know the following works

st.markdown("![Foo](http://www.google.com.au/images/nav_logo7.png)(http://google.com.au/)")

But the URL is displayed on the right side of the image.
Is there a way add the url to the image?
Thanks

Try

st.markdown("[![Foo](http://www.google.com.au/images/nav_logo7.png)](http://google.com.au/)")

and let us know how you get on.

1 Like

Perfect. Now how do you center that in the page?
I tried to add center after the quote but I guess that is not right.

Thanks

Iā€™m not sure that markdown allows centering text (or images). You should be able to do this using html tags / CSS instead.

1 Like