• Resolved ChrisColston

    (@chriscolston)


    I’m trying to overlap the default sidebar on top of the header. It displays fine but all links are redundant (the header div is still on top although i can see the sidebar. I’ve tried setting the positioning and z-index but to no avail

    any thoughts?

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

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you post the z-index and any relevant position CSS styles you’ve tried?

    Thread Starter ChrisColston

    (@chriscolston)

    One of the many iterations (this example doesn’t overlay)

    #branding hgroup{
    background-image: url("");
    background-size:60%;
    background-repeat:no-repeat;
    height:200px;
    position:relative;
    z-index:99;
    }
    #secondary {
    float: right;
    margin-right: 7.6%;
    width: 18.8%;
    margin-top:-200px;
    z-index:100;
    
    }

    thanks

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Is your website local to your machine or can you link it?

    Thread Starter ChrisColston

    (@chriscolston)

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    all links are redundant

    I’m not experiencing this, which links are redundant?
    Which browser & browser version are you using?

    Thread Starter ChrisColston

    (@chriscolston)

    Sorry, if you could refresh now you should see what i mean

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    When using z-index, you need to apply position: relative (or absolute) to the parent of the elements you want to apply to.

    So you ought to apply position: relative; to <div id="page">.
    You also should apply a z-index value lower in the <header> element, than the z-index value in the sidebar element.

    Thread Starter ChrisColston

    (@chriscolston)

    ok so I’ve now got:

    #page {
    	margin: 0em auto;
    	max-width: 1000px;
    background-image:url();
    background-size:100%;
    background-repeat:no-repeat;
    position: relative
    }
    #branding hgroup{
    background-image: url("");
    background-size:60%;
    background-repeat:no-repeat;
    height:200px;
    position: relative;
    z-index:99
    
    }
    #secondary {
    	float: right;
    	margin-right: 7.6%;
    	width: 18.8%;
    margin-top:-200px;
    position: relative;
    z-index:100;
    
    }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Instead of #branding hgroup, you should apply the z-index to #branding because at the moment there is a z-index of 9999 applied.

    Thread Starter ChrisColston

    (@chriscolston)

    Totally missed that, Thanks so much Andrew

    Thread Starter ChrisColston

    (@chriscolston)

    thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Twenty twelve and z-index property’ is closed to new replies.