• Resolved jloowi

    (@jloowi)


    Hello,

    I’m trying to hide a specific div element, but only on a specific page ID, and using only a line of code in the CSS stylesheet.

    In my case, I want to prevent a footer section from appearing, for instance, on page id #2.

    I tried the following code, but it doesn’t work:

    #footer body.page-id-2 { display: none !important; }

    I think I’m close:

    #footer { display: none !important; }

    the last code above successfully hides the div, but it’s applied everywhere. I want this to apply only to page id 2.

    Can anyone guide me?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jloowi

    (@jloowi)

    Ok it’s a stupid fix, but here’s what worked:

    body.page-id-2 #footer { display: none !important; }

    I just got the order wrong.

    Hi jloowi,

    I tried that and didn’t work for me. Did you do anything additionally?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hiding a DIV element on a specific page only’ is closed to new replies.