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

1 Like

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.

2 Likes

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

how would one go about resizing the images dynamically

@HaxXeD Been trying the same thing. Any success?

Is there any way we can a local image ?

With newer versions of Streamlit, yes: