Link to home
Start Free TrialLog in
Avatar of Member_2_7966984
Member_2_7966984

asked on

Sidebar jumps to the right slightly when it becomes sticky

On this page of a site I am working on - http://bhanewsite.wpengine.com/telehealth/ 

The sidebar jumps a littlebit to the right once you scroll down and it becomes sticky

Guessing there may be some CSS that can be tweaked in order to get it to not jump over to the right like 20px when it becomes sticky

Thanks
Avatar of Francisco Igor
Francisco Igor
Flag of Canada image

I've added these rules to make it fixed. There is no sticky/fixed configuration for the header, I think for this reason there is a small flicker when changing after scrolling the page.

header.fusion-header-wrapper{
   position: fixed;
   width: 100%;
}


#main{
   padding-top: 95px;
}

Open in new window


95px is the size of the header, so when using position:fixed, the next container needs a translation to look the same way if it was inline.
Also you can use for the main container

#main{
   position: relative;
   top: 95px;
}

Open in new window

Avatar of Member_2_7966984
Member_2_7966984

ASKER

Thanks Franscisco

I tried adding the CSS to my stylesheet and even made it all !important  - however it is still happening

this is what I have in there now

header.fusion-header-wrapper{
   position: fixed !important;
   width: 100% !important;
}


#main{
   position: relative !important;
   top: 95px !important;
}
So my theme has an option to stich between flex box and legacy - when using flexbox this happens - when using "legacy" it doesn't - However on the page, I have a row of 3 different sized icons and I want them to all be horizontally centered aligned with each other - so switching to legacy mode discards my flex box alignments and all the icons become top left aligned- so that is why I want to have the flex box stuff active on this page 
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.