-1

What I want to acheive, by applying css styles is composition of content: enter image description here

I apply my style and I got result:

enter image description here

li {
  position: relative;
  list-style-type: none;
  border: 1px;
  border-color: red;
  border-style: solid;
}
div {
  border: 1px;
  border-color: green;
  border-style: solid;
}

div .xx {
  display: inline;
  width:100%;
} 

div .aa {
  position: absolute;
  dislay: inline;
  left: 0;
  width:50%;
}
div .bb {
  position: absolute;
  display: inline;
  right: 0;
  width:50%;
}
div .cc {
  postion: relative;
  display: block;
} 
<li>
  <div class="xx">
      <div class="aa">A</div>
      <div class="bb">B</div>
    </div>
  <div class="cc">C</div>
</li>

So "C" is under "A" and "B". Can anybody help me to fix it? Thanks!

Sensoray
  • 2,360
  • 2
  • 18
  • 27
lissajous
  • 371
  • 5
  • 17

1 Answers1

1

You can use display:flex; to make the inner divs even width.

li {
  position: relative;
  list-style-type: none;
  border: 1px;
  border-color: red;
  border-style: solid;
}
div {
  border: 1px;
  border-color: green;
  border-style: solid;
}
.xx{
    display:flex;
}
div .aa {
 flex-basis: 100%
}
div .bb {
 flex-basis: 100%
}
div .cc {
  width:100%;
  display: block;
}
<li>
  <div class="xx">
      <div class="aa">A</div>
      <div class="bb">B</div>
    </div>
  <div class="cc">C</div>
</li>
Sensoray
  • 2,360
  • 2
  • 18
  • 27