How to overwrite Divs without position Absolute and relative? CSS

Asked

Viewed 31 times

-3

Good afternoon, folks, how are you?

I’m looking for a way to overlay div’s position without Absolute and relative, would like?

if I use any of these, it ends up leaking into my header (which is with the position Fixed) when scrolling the page.

Any suggestions?

I need element2 to override element 1 and 3, stay in the middle of both, but overlap.

ex: html : `

    </head>
    <body>
       <header class='header'> </header>

      <div class="elemento1">a </div>
      <div class="elemento2">b </div>
      <div class="elemento3">c </div>
    </body>``

CSS: .header{ position: fixed; }

  • There is little information in the question to give a good answer, but if I understand correctly you can use transform: translate and its variations.

  • this overlaps also, Rafael, but ends up having the same effect of position Absolute and relative, it overwrites the header also when scrolling the screen.

  • You can use position Absolute and use z-index in the header.

  • it worked, thank you very much, sam!

1 answer

-3

This is not the case in this question, but if you have a div within another div, the internal div may be totally or partially masked due to overflow: Hidden, use in overflow: Visible. Maybe it’s a solution to use this for your case.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.