官术网_书友最值得收藏!

Icons

The second property of our amenity objects isicon. This is actually a class relating to an icon in the Font Awesome icon font. We've installed Font Awesome as an NPM module already, so add this to the head of the page to now use it.

index.html:

<head>
  ...
  <link rel="stylesheet" href="node_modules/open-sans-all/css/open-sans.css">
  <link rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.css">
  <link rel="stylesheet" href="style.css" type="text/css">
</head>

Now we can complete the structure of ouramenitiessection in the template.

index.html:

<p class="lists">
  <hr>
  <p class="amenities list">
    <p class="title"><strong>Amenities</strong></p>
    <p class="content">
      <p class="list-item" v-for="amenity in amenities">
        <i class="fa fa-lg" v-bind:class="amenity.icon"></i>
        <span>{{ amenity.title }}</span>
      </p>
    </p>
  </p>
</p>

style.css:

.list {
  display: flex;
  flex-wrap: nowrap;
  margin: 2em 0;
}

.list .title {
  flex: 1 1 25%;
}

.list .content {
  flex: 1 1 75%;
  display: flex;
  flex-wrap: wrap;
}

.list .list-item {
  flex: 0 0 50%;
  margin-bottom: 16px;
}

.list .list-item > i {
  width: 35px;
}

@media (max-width: 743px) {
  .list .title {
    flex: 1 1 33%;
  }

  .list .content {
    flex: 1 1 67%;
  }

  .list .list-item {
    flex: 0 0 100%;
  }
}
主站蜘蛛池模板: 普兰店市| 罗江县| 龙川县| 定兴县| 高雄县| 社旗县| 湟中县| 平定县| 长泰县| 南城县| 会理县| 仁化县| 都安| 斗六市| 哈密市| 陵川县| 大同县| 临西县| 博客| 凉山| 瓦房店市| 河西区| 资阳市| 兴国县| 土默特左旗| 库尔勒市| 特克斯县| 长宁区| 合水县| 华宁县| 讷河市| 越西县| 松原市| 三江| 黄平县| 呼伦贝尔市| 贵德县| 汉源县| 葫芦岛市| 资兴市| 布尔津县|