0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

FontAwesomeの導入

Posted at

##FontAwesomeとは
Webフォントの一種。facebookやtwitterのロゴなどに使用できる。

##FontAwesome用のgemをインストール

Gemfile
gem 'font-awesome-sass'
#最下部に追加する

Gemfileに追記したら、bundle installしてサーバーを再起動

##HTMLで使用する場合

  • head内にリンクを記述
  • 任意の場所にアイコンの記述
application.html.erb
#head内
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
###中省略
<div class="iconのクラス名">
 <i class="fas fa-acorn"></i> #FontAwesomeからコピーしたコードを挿入
</div>

以下のリンクから飛んで使いたいWebフォントを探そう!
https://fontawesome.com/icons?d=gallery

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?