Good evening, I know that this doubt has been answered here several times, but none of it worked for me and I will explain why.
In all the solutions presented it is necessary to change the parameter position: relative;
to position: fixed;
, however this configuration has the inconvenience of having to do the manual centralization of Div, specifying its values in px
or other parameter, the% of%, which should be width
, because if you get out of self, the div of the menu bar does not scale itself according to the resizing of the browser window with the mouse, or the format of the pc of the user.
So I would like a purely javascript solution for this case, without CSS. Detail, I just want to fix, with no additional effect like animations, etc ... Thanks in advance.