Forums

[resolved] How do I make my CSS work with admin bar? (3 posts)

  1. jrandomh
    Member
    Posted 4 months ago #

    I am usng the following CSS to position some lefts in the top left corner of my site (they're login/logout/profile type links):

    my-links {
        height: 20px;
        position: fixed;
        right: 1%;
        top: 1%;
    }

    They're unobtrusive, but always on screen for user access (hence the fixed position).

    They are covered by the admin toolbar when viewing the site logged in.

    Is there any esasy way to keep the principle of having them on screen, in the same position, but move down relative to the admin toolbar (like all of the other site content does)?

    Thanks, JRH.

  2. alchymyth
    The Sweeper
    Posted 4 months ago #

    if your theme actually uses body_class(), try to use the body_class output of .logged-in or .admin-bar to reposition your links;

    example:

    .admin-bar .my-links { margin-top: 64px; }

  3. jrandomh
    Member
    Posted 4 months ago #

    Awesome, that worked (with top:4% rather than margin-top)

    Thanks :)

Reply

You must log in to post.

About this Topic