WordPress.org

Ready to get started?Download WordPress

Forums

Coraline
[resolved] Fixed header only works on index page (6 posts)

  1. slarus
    Member
    Posted 6 months ago #

    Hello!
    I found a code to make the header fixed and It works perfect, but the problem is that it only works on front page, at my other pages and my posts it "blocks" the scroll and I can't do anything! But when I deactivate the "position:fixed;" line the scroll works but my header is not fixed (sticked to the top) :(
    Can somebody help me please?
    Thanks!

    #header {
            position: fixed;
            top: 0;
            background: rgb(255, 255, 255);
            background: rgba(255, 255, 255, 1);
            z-index: 10;
            height: 228px;
            width: 880px;
    }
    #content-box {
            margin-top: 220px;
    }
  2. Could you please provide a link to your site? On my test site your code works the same way on all pages and posts, as well as the front page, so I'll need to see it in action on your site. Thanks.

  3. slarus
    Member
    Posted 6 months ago #

    Thanks for your answer Kathryn!
    Yes of course!
    My site is: http://www.mivrastvdio.com
    I dont understand where is the error :(

  4. To troubleshooting this, I suggest starting by temporarily commenting out everything in your child theme's style.css file except the CSS you showed me above. If it works, then paste bits back a small bit at a time until you find the culprit.

    If you've also made changes to other theme files in a child theme, I'd do the same with them - remove all your child theme template files and see if the CSS works, and then add one file back at a time to find out which one is causing the conflict.

    Let me know how it goes.

  5. slarus
    Member
    Posted 6 months ago #

    Kathryn thanks for your answer!
    I found that the problem is in the header file of the child theme that I created.
    I will try to resolve it from there!
    Thanks a lot for your attention and your good advice :)

  6. Great, glad you're all set!

Reply

You must log in to post.

About this Theme

About this Topic