0

My divs with position:absolute or relative keep showing on top of my other divs , even so that i already gave them a float , is there anyway to clear the float state of the positions:relative or absolute?

.topo {
  position: relative;
}

.area-logo {
  position: absolute;
  width: 798px;
  background-color: green;
  left: 0px;
  top: 0px;
  background: url(topo-imagem-principal.png);
  height: 250px;
}

.area-menu {
  background: url(topo-imagem-lateral.png);
  position: absolute;
  top: 0px;
  right: 0px;
  width: 639px;
  height: 250px;
}

.bottom-div {
  width: 50%;
  float: left;
}

bottom-div {
  width: 50%;
  float: right;
}
Oleg Barabanov
  • 2,468
  • 2
  • 8
  • 17
  • 4
    Could you provide some html code? I'm trying to help you but I'm not sure what you're trying to achieve/learn. – Adrian Aug 17 '22 at 14:20
  • 1
    You are trying to use 2 layouts methods at the same time. Either use positioning or float. And about the stacking order. You can use the `z-index` property to specify the stacking/layering order which you want your DIVs to be in. Also, Add a runnable example please. – Abdulrahman Ali Aug 17 '22 at 14:22
  • Welcome to Stack Overflow! This does not answer your question directly, but please do not use `float` https://stackoverflow.com/questions/9776840/is-float-for-layout-bad-what-should-be-used-in-its-place – disinfor Aug 17 '22 at 14:28

0 Answers0