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

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%;
  }
}
主站蜘蛛池模板: 乡宁县| 罗江县| 东乌珠穆沁旗| 石嘴山市| 黑河市| 文水县| 普兰县| 台东县| 洛扎县| 鲁山县| 高平市| 霞浦县| 姚安县| 隆化县| 慈利县| 高邑县| 龙门县| 新闻| 保康县| 饶平县| 丹凤县| 长白| 通河县| 兴安县| 宁城县| 永清县| 宁波市| 中山市| 乐业县| 武鸣县| 景洪市| 环江| 民勤县| 洛隆县| 漠河县| 凉山| 肃南| 大化| 芦山县| 资源县| 巴彦淖尔市|