When the data selected by while is paired with css, the last css customer of while?

  .swiper{
    vertical-align: top;
    width: 82%;
    display: inline-block;
    margin: 0px 0px 20px 20px;
    white-space: normal;
  }
<? while ($row = mysqli_fetch_array($sql)){?>
    <div class="swiper"></div>
<? }?>

the last moment of this while

swiper I want to change the style
change margin: 0px 0px 20px 20px; to margin: 0px 20px 20px 20px;
but all variables before the last one remain unchanged.
what can I do?

Jun.25,2021
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-1e9ad8f-4ecdb.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-1e9ad8f-4ecdb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?