You can't do that if .fixed
element is acting as a holder for any of its children.
This means that if, for example, you set your h3
with an absolute position to the bottom, it will go to the bottom of its parent element.
z-index
works the same way. Its value will be inherited by the parent. Since the z-index
default value is 0
, your .fixed
element has a z-index
value of 0
, and your h3
has first 0
and then 300
.