Hi ,
I have my streamlit app on a GitHub depository
On mt sidebar I added an image of the LinkedIn logo using this code
st.sidebar.image("LinkedIn.png")
Hereās the result

I want to make this image clickable so it can redirect to my LinkedIn page.
Can someone please help me ?
Thanks in advance
1 Like
Hi @AliaBoudehane,
Thanks for posting!
You can use st.markdown to embed the image with a hyperlink to LinkedIn.
Hereās the code you can try (make sure to add your username in the LinkedIn URL:
st.sidebar.markdown(
"""<a href="https://www.linkedin.com/in/your-profile-username/">
<img src="data:image/png;base64,{}" width="25">
</a>""".format(
base64.b64encode(open("LinkedIn.png", "rb").read()).decode()
),
unsafe_allow_html=True,
)
Let me know if this works.
1 Like
Hello @tonykip ,
Thanks for your answer.
It perfectly worked !
Have a nice day.
1 Like
Hi @AliaBoudehane,
Glad it worked! Happy Streamlit-ing! 
system
Closed
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.