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

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%;
  }
}
主站蜘蛛池模板: 贡嘎县| 繁昌县| 宜兴市| 忻州市| 凯里市| 滨州市| 平利县| 临朐县| 亚东县| 徐水县| 平湖市| 万源市| 库尔勒市| 军事| 柏乡县| 沂水县| 玉山县| 昭通市| 安宁市| 会泽县| 宜宾市| 辉县市| 邳州市| 香格里拉县| 叙永县| 云南省| 南平市| 瓦房店市| 沙雅县| 民权县| 北京市| 吉安县| 龙胜| 遂川县| 贵州省| 无极县| 龙州县| 神池县| 淮阳县| 新田县| 北宁市|