Support » Fixing WordPress » Widget and header

  • Resolved AJ20152015

    (@aj20152015)


    Hi,

    I have a Text widget in the sidebar which contains a DIV with a CSS class “box”. I want to make it stick on the top of the blog. So, I used this CSS:

    .box {
    position:fixed;
    left:975px;
    top:0px;
    width:100px;
    background:red;
    height:30px;
    }

    The DIV does move to up and stick above. However, it seems my banner appears in front of it. So, the first top 200px, the DIV does not appear because the banner covers it. Once I scroll down, then it appears.

    I tried to put z-index:-9999; on the header container but it still covers the DIV.

    Help…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Link to site?

    Have you tried adding a position:relative; as well as the negative z-index to the header?

    Evan

    The site is locally. I mean on XAMPP. I did add position relative but didn’t work. I add it to the Header class.

    try using a browser inspection tool to find out what z-index is used in the banner formatting.

    alternatively, try to add a high z-index to the .box styles.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Widget and header’ is closed to new replies.