# HTML/ CSS/ Javascript use with streamlit

**URL:** <https://discuss.streamlit.io/t/html-css-javascript-use-with-streamlit/50332>\
**Category:** Show the Community!\
**Created:** [August 29, 2023, 12:58pm UTC](https://discuss.streamlit.io/t/html-css-javascript-use-with-streamlit/50332 "2023-08-29T12:58:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SanjayForever](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/sanjayforever/32/31348_2.png) [@SanjayForever](https://discuss.streamlit.io/u/SanjayForever)\
**Post date:** [August 29, 2023, 12:58pm UTC](https://discuss.streamlit.io/t/html-css-javascript-use-with-streamlit/50332/1 "2023-08-29T12:58:42Z")

</div>

Is there a way to use HTML/ CSS and Javascript without making the app static?

---

<div class="post-metadata">

**Author:** ![IndigoWizard](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/indigowizard/32/49719_2.png) [@IndigoWizard](https://discuss.streamlit.io/u/IndigoWizard)\
**Post date:** [August 29, 2023, 1:05pm UTC](https://discuss.streamlit.io/t/html-css-javascript-use-with-streamlit/50332/2 "2023-08-29T13:05:07Z")

</div>

You can inject HTML, CSS & JavaScript through multiple methods, most commonly the st.markdown():

```python
st.markdown("""
   some streamlit class name {
     background: red;
  }
""", unsafe_allow_html=True)

```

You can do the same with javascript if you can get the classes names etc or inject it within an HTML component, for this I redirect you to this question I just answerd where you can find how to add whole HTML comonents or just iframes:

> [@How do I embed an existing non streamlit webpage to my streamlit app](https://discuss.streamlit.io/t/how-do-i-embed-an-existing-non-streamlit-webpage-to-my-streamlit-app/50326/3):
>
> Demo with solution & code sample: [https://shinosuke-lab-2.streamlit.app/](https://shinosuke-lab-2.streamlit.app/)Iframe embedding: For the iframe you can try something like this: import streamlit as st import streamlit.components.v1 as components def run(): iframe\_src = "https://open.spotify.com/embed/track/59BweHnnNQc5Y55WO30JuK?utm\_source=generator" components.iframe(iframe\_src) # You can add height and width to the component of course. if \_\_name\_\_ == "\_\_main\_\_": run() Whole HTML embedding: As you can read on the…

And here’s a demo app for that:

[https://shinosuke-lab-2.streamlit.app/](https://shinosuke-lab-2.streamlit.app/)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [February 25, 2024, 1:05pm UTC](https://discuss.streamlit.io/t/html-css-javascript-use-with-streamlit/50332/3 "2024-02-25T13:05:13Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
