Background position when logged in

SupportCategory: Ta MusicBackground position when logged in
Iain asked 3 years ago

When you log into a site with the TA Music theme on it, the background appears to cut into the top menu bar. This is because the WordPress admin bar is adding a 32px margin to the HTML element, and the coloured background is positioned absolutely. When the page is less than 600px wide, WordPress changes the style of the admin bar so it needs a -46 px margin to go back to the top.
Here’s the code I added to the top of style.css, which seems to fix this.

0.0 Fix background alignment (IDSH)
body {
    position: relative;
@media (max-width: 600px) {
    #wpadminbar {
        margin-top: -46px;