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

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%;
  }
}
主站蜘蛛池模板: 平和县| 怀来县| 崇左市| 平阳县| 东阳市| 泗阳县| 宁城县| 繁昌县| 安吉县| 林西县| 崇州市| 赣州市| 吴堡县| 郁南县| 左权县| 沾益县| 阿鲁科尔沁旗| 和林格尔县| 阳高县| 临高县| 宁蒗| 和平县| 阿拉善左旗| 天水市| 民县| 平武县| 济宁市| 花垣县| 商河县| 玉林市| 玉溪市| 广水市| 那曲县| 白河县| 越西县| 洛阳市| 宁海县| 定兴县| 左云县| 昆明市| 凯里市|