Ask for a more advanced equal distribution.

six parallel div how each fixed length and width 60px is displayed in a row of three, the spacing and margin of each two are the same and adaptive
|-div- |
|-div- |
how to implement

Css
May.11,2021

get the browser window width first. Then subtract three div widths 180 from the obtained value, and then use the resulting value / 4, which is the distance value of each div


demo attach a link
calc (25%-45px) is the result of calc ((100%-(3% 60) px) / 4)

but generally speaking, if I am sure that there are six in two lines, I will not try to save one line by writing two row, and the following three elements in each row. With a justify-content: space-evenly;, I will get the effect you want.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style type="text/css">
    body{
      margin: auto;
      padding: 0;
    }
    .list{
      display: flex;
      align-items: center;
      flex-wrap: wrap;
    }
    .list>div{
      width: 60px;
      height: 60px;
      background: pink;
      margin-left: calc(25% - 45px);
      margin-bottom: 10px;
    }
    .list>div:nth-child(3n+3){
      margin-right: calc(25% - 45px);
    }
  </style>
</head>
<body>
  <div class="list">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
  </div>
</body>
</html>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb2e6c-2412.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb2e6c-2412.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?