-
AuthorPosts
-
September 30, 2020 at 4:03 am #1249533
Hi,
I used a code found on this forum and made my right sidebar main menu sticky on desktop.
I also fixed my mobile header to be sticky.
this is my code:
@media only screen and (min-width: 768px) {
.html_header_sidebar #top #header.av_always_sticky {
right: 0;
}
.html_header_left #main {
margin-left: auto;
}.html_header_sidebar #header .av-main-nav {
text-align: left;
}.html_header_sidebar #top #header {
position:fixed!important;
width: 300px;
position: absolute;
min-height: 100%;
border-bottom: none;
}
}@media only screen and (max-width: 989px) {
.responsive #top #main {
margin-top: 82px;
}
.responsive #top #wrap_all #header {
position: fixed;
}
#top .av_header_transparency .header_bg {
background-color: #ffffff;
}
}@media only screen and (max-width: 767px) {
#top .av_header_transparency #header_meta {
background: blue;
box-shadow: none;
border-bottom: 1px solid rgba(255,255,255,0.25);
}here are my problems:
1. The menu is sticky, but not “Sticky if Sidebar is smaller than the screen height, scroll otherwise”. and on smaller desktop screens it can’t be scroll down.
2. For some reason, the code added a large pudding on both sides of the main content.can you pls hlpe me fix both of those problams?
Thanks so much!October 7, 2020 at 12:42 pm #1251128Hey MPPcreative,
Sorry for the delay. The following css code causes the sidebar to always stick regardless of the selected header settings in the theme options.
.html_header_sidebar #top #header { position: fixed !important; width: 300px; position: absolute; min-height: 100%; border-bottom: none; }
Is the css intended for mobile view? If it is, then you have to wrap it inside a css media query.
@media only screen and (max-width: 767px) { /* Add your Mobile Styles here */ }
Best regards,
IsmaelOctober 8, 2020 at 1:33 pm #1251417Hi Ismael
Thanks for your replay, for some reason both problems are now fixed.
I changed the header from the right side to the left side. it’s still on the right side and both problems are fix.Thank you
Rachel- This reply was modified 4 years, 2 months ago by Rachel. Reason: fixed it myself
October 8, 2020 at 6:17 pm #1251540Hi MPPcreative,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.