• Resolved oman2

    (@oman2)


    I have no idea what to put into the search bar for this, so I’ll just put my problem here – links are welcome.

    I’m using anchors to jump from my contents list at the top of my page to any section of it, but when I reach the target via the anchor, the menu bar at the top (Just Write Free) attaches to the top of the page (this is good) but covers the section title that I’ve placed the anchor on.

    If I can attach a screenshot I will, but here’s a page example – scroll down to contents.

    I’m just using simple anchors (are there any others?):

    <a href="link-name">Link</a>

    <a name="link-name">Target</a>

    Hopefully you can see what I mean, I like the menu attaching to the top of the bar, but it’s not treated as part of the page so the menu covers my title and part of the text. It’s a bit confusing if you don’t know where you are on the page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try this in your custom css:

    .single-content h3 a {
      display: block;
      margin-top: -100px;
      padding-bottom: 100px;
    }

    If your theme does not have a setting where you can enter custom css, you can use a plugin like this one:
    https://wordpress.org/plugins/simple-custom-css/

    Credit: https://css-tricks.com/hash-tag-links-padding/

    Thread Starter oman2

    (@oman2)

    Fantastic!

    Thanks for the solution Lorro – it was a rather elegant way to modify the existing code without having to dig into the WordPress core files and/or create a custom theme as other people have suggested in the past.

    I had to modify it slightly to 200 pixels to fit the aesthetic a little better, but it’s a very simple way to solve the problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Anchored title covered by menu bar’ is closed to new replies.