1

Drupal 7

The toolbar is sticky at the top even you scroll down the page.

How can I make it unsticky at the top?

Thanks.

1

1 Answer 1

4

The fixed position is hard-coded into the toolbar.css file included with the core module.

To override it add the following to a CSS file that you're including with the admin theme:

#toolbar {
  position: static !important;
}

body.toolbar, body.toolbar-drawer {
  padding-top: 0 !important;
}

The !important declarations may or not be necessary depending on the order of inclusion...try without it first, and if it doesn't work, try adding it.

3
  • so the sticky effect is made by the css not javascript?
    – gilzero
    Apr 30, 2012 at 12:48
  • 1
    @gilzero Yep, it's simply done with position: fixed on the #toolbar element. The body needs padding when this is the case, but doesn't if the element is not fixed, hence the need to remove it when making the toolbar non-fixed
    – Clive
    Apr 30, 2012 at 12:50
  • 3
    "auto" is not a valid value for position in CSS 2.1 or CSS 3. The default value is "static".
    – mpdonadio
    Apr 30, 2012 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.