• Resolved sydbarrett74

    (@sydbarrett74)


    Hi all,
    I’m using a child theme I adapted from Diarjo-lite and am having trouble with the fixed header (including logo and menu) overlapping the content container. I have attempted to follow the instructions here but am unable to get it to work fully. The problem is that in my child theme’s style.css, I am referring to the content container as #container. The website in question is https://www.eastcoasttarot.com.

    Here is what I have in style.css:

    /*
    Theme Name: Diarjo-Lite Child
    Description: Child theme for East Coast Tarot
    Author: Victor Escobar
    Version: 1.0
    Template: diarjo-lite
    */
    
    @import url ("../diarjo-lite/style.css");
    div#page {
    	background: rgba(123,123,123,.0);
    }
    
    /*
    Site Header
    ---------------------------------------------------------------------------------------------------- */
    /* This is where the magic happens. You need
     * to assign a fixed position in order for
     * everything else to work correctly.
    --------------------------------------------- */
    #header {
    	position: fixed;
    	top: 0;
    	width: 100%;
    	z-index: 2000;
    }
    
    /* This will ensure your site looks correct
     * when the admin bar is displaying.
    --------------------------------------------- */
    /*body.admin-bar #header {*/
    #wpadminbar #header {
    	top: 28px /* Make this 32px if MP6 is installed */
    }
    
    /*
    <br /> #container {<br /> position: absolute;<br /> left: 35%;<br /> top: 7em;<br /> margin-left:35%;<br /> margin-right:60px;<br /> margin-top:70px;<br /> padding:0.5em;<br /> }<br /> #primary {<br /> margin-top: 70px;<br /> }<br />
    */
    
    #container {
    	position: absolute;
    	margin-top: 70px;
    	padding: 0.5em;
    }
    
    /*
    Body Element
    ---------------------------------------------------------------------------------------------------- */
    
    /* This Should Be Equal to the Height of your
     * fixed header bar.
    --------------------------------------------- */
    body {
      	padding-top: 164px;
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • LauraHartwigDesign

    (@laurahartwigdesign)

    Hi Sydbarrett74,
    As you can see from the demo site here: https://demo.themeinprogress.com/diarjo/standard-page/
    It looks like they have the #header as relative rather than fixed.
    And then if you remove this:
    body {
    padding-top: 164px;
    }
    You should be in good shape.

    Let me know if that doesn’t work, and if it does, please mark resolved. Good luck!

    Thread Starter sydbarrett74

    (@sydbarrett74)

    I removed the padding-top line and the #header is declared as position: absolute in the style.css of my child theme. The header is still overlapping the top bit of my container. If you click on the ‘About Rev. Paula’ link, you’ll see what I mean.

    LauraHartwigDesign

    (@laurahartwigdesign)

    Sorry, I didn’t explain myself well enough. You need to change #header to position: relative. That should work. If not, let me know.

    Thread Starter sydbarrett74

    (@sydbarrett74)

    position: relative is the default behaviour. That’s not what I want. I want the header to remain fixed, but the visitor to be able to scroll through the container’s content. What I want essentially is to emulate the old 1990’s behaviour of having multiple frames with an invisible border between frames.

    https://www.comptechdoc.org/independent/web/html/guide/htmlframes.html

    LauraHartwigDesign

    (@laurahartwigdesign)

    Sorry, I must have misunderstood what you were looking for, however, with such a huge header area, I would recommend against making the header fixed because on devices like tablets in landscape, there is going to be a very small area to actually read the content.
    However, if that’s what you really want to do, you can put #header back to fixed and try
    .container .content {
    margin-top: 350px;
    }

    Hope this gives you what you’re looking for.

    Thread Starter sydbarrett74

    (@sydbarrett74)

    I finally solved the problem by installing a plugin called myStickymenu. It doesn’t do what I want perfectly, but comes close enough given the limits set by WP’s architecture.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Header overlapping content container’ is closed to new replies.