Why other divs do not appear?

0

I put a div as relative, and the other dives as absolute, but only the div 3 is appearing because it's the last guess, the problem is, why are they grouping like this?



asked by anonymous 28.03.2017 / 17:36

1 answer

0

Dude, is absolute positioning necessary? If you work with relative numbers (%) and absolute positioning, you will end up giving trouble. In this example I took this placement and simplified it.

body {
  padding: 0;
  margin: 0;
}

#ofertas {
  width: 20%;
  background-color: grey;
  position: relative;
}

#ofertas ul li {
  list-style: none;
}

.venda {
  height: 150px;
  width: 80%;
  background: blue;
  display: inline-block;
  padding: 0;
  margin: 0 auto;
  margin-bottom: 50px;
}

.vendaUm {
  background: red;
}

.vendaDois {
  background: green;
}

.vendaTres {
  background: yellow;
}
<div id="ofertas">
  <ul>
    <li class="venda vendaUm">
      Casa 1
    </li>


    <li class="venda VendaDois">
      Casa 2
    </li>


    <li class="venda vendaTres">
      Casa 3
    </li>


  </ul>
</div>
    
28.03.2017 / 17:59