import streamlit as st import streamlit.components.v1 as components st.title("嵌入 HTML 內容的範例") # 使用 components.html() 來插入自訂 HTML html_code = """

這是自訂的 HTML 標題

這是一段內嵌的 HTML 內容,你可以自由修改。

""" # 透過 components.html() 來顯示 HTML,height 參數設定顯示區域的高度 components.html(html_code, height=200)