Position a fixed div above a relative div/h1

jumbot

I have my work in progress website that includes a navigation menu that pops out one a button click. I want this (fixed div) to appear above the h1 headline.

Here is my HTML:

<div id="topbar">
    <div id="logo"><img src="images/title.png" style="color: gold;" alt="jamesthistlewood.co.uk" /></div><div id="menu" onclick="toggleMenu();"></div>
    <div id="menuitems"><div id="menuitem">About</div><div id="menuitem">Jobs</div><div id="menuitem">Portfolio</div></div>
</div>
<div id="main">
    <div id="leftpanel">
      <div id="cycler">
        <a href="http://readometer.co.uk" target="_blank"><img class="active" src="images/readometer.png" alt="Read-o-meter" /></a>
        <a href="http://trailhunter.co.uk" target="_blank"><img src="images/trailhunter.png" alt="My image" /></a>
        <a href="http://jamesthistlewood.co.uk/chatter" target="_blank"><img src="images/chatter.png" alt="My image" /></a>
        <!-- ignore the cycler, this makes no difference to the problem -->
      </div>
    </div>
    <div id="rightpanel">
      <h1>Headline Text goes right here</h1>
    </div>
  </div>
</div>

Here is my CSS:

body { margin: 0;
       background: #FEFEFE;
       font-family: "actor", sans-serif;
}

#topbar { background: black;
          height: 90px;
          position: fixed;
          width: 100%;}

#topbar #logo {position: absolute;
               left: 20px; height: 68px;
               }

#topbar #logo img { height: 85px; padding: 2.5px 0 2.5px 0;}

#topbar #menu {position: absolute;
               right: 20px; top: 10px;
               height: 70px; width: 70px;
               background-image: url("images/menu1.png");}

#topbar #menu:hover {background-image: url("images/menu2.png");}

#topbar #menuitems { position: fixed;
                    background: white;
                    width: 150px; min-height: 10px;
                    right: 20px; top: 95px;
                    border: 1px solid #CDCDCD;

}

#topbar #menuitems #menuitem { 
  font-weight: bold; text-transform: uppercase; padding: 5px;
  height: 30px; text-align: center; float: top;
  line-height: 30px;
}

#topbar #menuitems #menuitem:hover {
  background: grey;
}

#main { position: relative;
        top: 90px;
        width: 100%;
        z-index:2;

}

h1 { text-transform: uppercase; letter-spacing: 2px;}

#leftpanel {width: 50%; float: left;}
#rightpanel {width: 50%; float: right;}

I have already tried changing the z-index of some things, but to no avail.

Any help is appreciated!

sinisake

Place very high z-index on this element:

#topbar #menuitems { position: fixed;
                    background: white;
                    width: 150px; min-height: 10px;
                    right: 20px; top: 95px;
                    border: 1px solid #CDCDCD;
     z-index:9999;

}

Demo: demo

Solved:

#topbar { background: black;
          height: 90px;
          position: fixed;
          width: 100%;z-index:9;}

hopefully... http://jsfiddle.net/6z8qc9pq/2/ Try this link, works, at least in Chrome...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Position a fixed div above a relative div/h1

From Dev

Make a relative position div follow a fixed position div when scrolling

From Dev

How do I position a div relative to a fixed position div?

From Dev

How to adjust position of a div relative to a div above it upon height change?

From Dev

How to adjust position of a div relative to a div above it upon height change?

From Java

Fixed position but relative to container

From Dev

position relative overlapping position fixed

From Dev

how can I move div with position:relative above div with position:absolute?

From Dev

fixed position of button above image

From Dev

Fixed position relative to parent container

From Dev

Position fixed relative to a block, not to the viewport

From Dev

Div not visible if position: relative

From Dev

position text relative above an other text

From Dev

Fixed nav under a relative div

From Dev

fixed position for a div inside a div

From Dev

How to have fixed position of element but relative to container

From Dev

How to position a relative element after a fixed element

From Dev

5 fixed div, with relative div over them

From Dev

CSS: fixed div next to relative div

From Dev

5 fixed div, with relative div over them

From Dev

position image absolutely to relative div

From Dev

Full height to div with relative position

From Dev

Add element to div in a relative position

From Dev

Add element to div in a relative position

From Dev

Absolute within position relative div?

From Dev

Position fixed element within fixed element relative to page

From Dev

Fixed Header when the Div above is scrolled past

From Dev

CSS: absolutely position div above parent div

From Dev

HTML/CSS/JS Fixed position div is not fixed

Related Related

  1. 1

    Position a fixed div above a relative div/h1

  2. 2

    Make a relative position div follow a fixed position div when scrolling

  3. 3

    How do I position a div relative to a fixed position div?

  4. 4

    How to adjust position of a div relative to a div above it upon height change?

  5. 5

    How to adjust position of a div relative to a div above it upon height change?

  6. 6

    Fixed position but relative to container

  7. 7

    position relative overlapping position fixed

  8. 8

    how can I move div with position:relative above div with position:absolute?

  9. 9

    fixed position of button above image

  10. 10

    Fixed position relative to parent container

  11. 11

    Position fixed relative to a block, not to the viewport

  12. 12

    Div not visible if position: relative

  13. 13

    position text relative above an other text

  14. 14

    Fixed nav under a relative div

  15. 15

    fixed position for a div inside a div

  16. 16

    How to have fixed position of element but relative to container

  17. 17

    How to position a relative element after a fixed element

  18. 18

    5 fixed div, with relative div over them

  19. 19

    CSS: fixed div next to relative div

  20. 20

    5 fixed div, with relative div over them

  21. 21

    position image absolutely to relative div

  22. 22

    Full height to div with relative position

  23. 23

    Add element to div in a relative position

  24. 24

    Add element to div in a relative position

  25. 25

    Absolute within position relative div?

  26. 26

    Position fixed element within fixed element relative to page

  27. 27

    Fixed Header when the Div above is scrolled past

  28. 28

    CSS: absolutely position div above parent div

  29. 29

    HTML/CSS/JS Fixed position div is not fixed

HotTag

Archive