georad commited on
Commit
8918a49
·
verified ·
1 Parent(s): 20402fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -17
app.py CHANGED
@@ -1,35 +1,34 @@
1
  import streamlit as st
2
 
3
- # Custom CSS for sticky header
4
  st.markdown("""
5
  <style>
6
- .stApp header {
7
  position: fixed;
8
  top: 0;
 
 
9
  z-index: 999;
10
  background-color: white;
11
- width: 100%;
 
12
  }
13
 
14
- /* Add padding to the main content to prevent it from being hidden under the fixed header */
15
  .main .block-container {
16
- padding-top: 5rem;
17
- }
18
-
19
- /* Additional CSS to ensure compatibility with Hugging Face iframe embedding */
20
- .stApp {
21
- overflow: auto;
22
- }
23
-
24
- div[data-testid="stVerticalBlock"] {
25
- padding-top: 1rem;
26
  }
27
  </style>
28
  """, unsafe_allow_html=True)
29
 
30
- # Your app content
31
- st.title("My App with Sticky Header")
32
- # Rest of your app...
 
 
 
 
 
33
 
34
  # --- PAGE SETUP ---
35
  type_text_page = st.Page(
 
1
  import streamlit as st
2
 
3
+ # Custom CSS
4
  st.markdown("""
5
  <style>
6
+ .header-container {
7
  position: fixed;
8
  top: 0;
9
+ left: 0;
10
+ right: 0;
11
  z-index: 999;
12
  background-color: white;
13
+ padding: 1rem;
14
+ box-shadow: 0 2px 5px rgba(0,0,0,0.1);
15
  }
16
 
17
+ /* Add padding to content */
18
  .main .block-container {
19
+ padding-top: 7rem;
 
 
 
 
 
 
 
 
 
20
  }
21
  </style>
22
  """, unsafe_allow_html=True)
23
 
24
+ # Custom header
25
+ with st.container():
26
+ st.markdown('<div class="header-container">', unsafe_allow_html=True)
27
+ st.title("My App Title")
28
+ # Other header elements
29
+ st.markdown('</div>', unsafe_allow_html=True)
30
+
31
+ # Rest of your app content
32
 
33
  # --- PAGE SETUP ---
34
  type_text_page = st.Page(