• kaizerco

    (@kaizerco)


    I am trying to target an id (user-logo) only in a specific page.
    When I apply it to page ?page_id=26… it works fine:

    .page-id-26 #user-logo {
        border: 1px solid #021a40;
    }

    When I try it with my ‘posts page’ which is called: ?page_id=35
    like this:

    .page-id-35 #user-logo {
      	border: 1px solid #021a40;
    }

    It just doesn’t even show up in the CSS in firefox inspector.
    What am I doing wrong? is the posts page a special page!?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You need to show us the page with the issue

    Thread Starter kaizerco

    (@kaizerco)

    I guess it would help to see the pages.
    Check’em out:
    page id 26
    page id 35

    It’s just an example of a black border around the logo. Checking to see why it works in page 26 and not in page 35.

    Thanks

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If you see the source code of the page that doesn’t work, you’ll notice that there isn’t a class in the <body> that you’re trying to target.

    Thread Starter kaizerco

    (@kaizerco)

    Right!
    I wonder why the posts page doesn’t have a page id class in it… That’s something to check.

    Anyway, in this case, targeting the “blog” makes it work!

    .blog #user-logo {
      	border: 1px solid #021a40;
    }

    Thank you Andrew!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘target css on specific page works only on some pages’ is closed to new replies.