0

image from W3 ( i think)

So the image above says justify content can be applied to block containers, and after experimenting with this code i still dont see it working i.e it doesnt centre/end items on the main axis or block axis.

 <body>
  <div id="wrapper">
  <div id="i1" class="item">1</div>
  <div id="i2" class="item">2</div>
  <div id="i3" class="item">3</div>
  <div id="i4" class="item">4</div>
  <div id="i5" class="item">5</div>
</div>
</body>

My css

#wrapper {
    height: 60%;
    border: 5px dotted rgb(66, 199, 240);
    justify-content: center;
   /* align-content: center; */
}

.item {
    border: 3px dotted orange;
    width: 50%;
    height: 10%;
    background-color: rgb(248, 175, 149);
    font-size: 1.5em;
}
shuhei m
  • 67
  • 5

1 Answers1

0

try to add display:flex; on wrapper

Walnut
  • 9
  • 3