如何使文本居中并带有徽标旁边的徽标

时间:2018-10-02 15:23:35

标签: html css

我知道那里有很多解决方案,但是我尝试了大多数解决方案,只是无法弄清楚为什么我的图像略低于文本。.我尝试了display:flex ;,在边距处玩和填充,并进行对齐,但无法弄清楚。

.amenities-wrapper {
  margin: 15px 0;
  font-size: 0;
}

tr {
  align-items: center;
  margin-top: 8px;
  width: 250px;
}

td {
  margin-left: 100px;
  margin-right: 100px;
}

.amenities-text {
  font-size: 15px;
  margin-left: 10px;
  margin-right: 100px;
  line-height: 35px;
  display: inline-block;
}

.amenities-logo {
  width: 30px;
  height: 30px;
  vertical-align: middle;
  margin-bottom: 0.75em;
}
<div class="amenities-wrapper">
  <h3>AMENITIES & SERVICES</h3>
  <table>
    <tr>
      <td>
        <img src="images/wifi.png" class="amenities-logo" alt="WiFi" />
        <span class="amenities-text">High School Internet</span>
      </td>
      <td>
        <img src="images/parking.jpg" class="amenities-logo" alt="Parking" />
        <span class="amenities-text">Parking</span>
      </td>
      <td>
        <img src="images/airconditioner.png" class="amenities-logo" alt="Air Conditioner" />
        <span class="amenities-text">Air Conditioner</span>
      </td>
    </tr>
    <tr>
      <td>
        <img src="images/computer.png" class="amenities-logo" alt="Computer" />
        <span class="amenities-text">Desktop Computers</span>
      </td>
      <td>
        <img src="images/printer.png" class="amenities-logo" alt="Printer" />
        <span class="amenities-text">Printer</span>
      </td>
      <td>
        <img src="images/coffee.png" class="amenities-logo" alt="Thanks Cafe" />
        <span class="amenities-text">Thanks Cafe</span>
      </td>
    </tr>
  </table>
</div>

0 个答案:

没有答案