於 Fontawesome 圖示中加入文字

利用Fontawesome 可以透過HTML在圖示中加入文字.

利用DIV tag 及 CSS class fa-slack 將圖示以layer 形式顯示. 其中以class fa-text 輸入文字.

CSS

.calendar-text { margin-top: .3em; }
.file-text { margin-top: .2em; }


/* other styles for demo */
.fa-stack { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; }
.stacked-icons {
  margin-top: 20px;
  text-align: center;
}
.fa-stack + .fa-stack { margin-left: .3em; }
.fa-stack { margin-bottom: 20px; }

HTML

<div class="stacked-icons">
  <span class="fa-stack fa-3x">
    <i class="fa fa-calendar-o fa-stack-2x"></i>
    <strong class="fa-stack-1x calendar-text">27</strong>
  </span>

  <span class="fa-stack fa-3x">
    <i class="fa fa-comment fa-stack-2x"></i>
    <strong class="fa-stack-1x fa-stack-text fa-inverse">OK</strong>
  </span>

  <span class="fa-stack">
    <i class="fa fa-file-o fa-stack-2x"></i>
    <i class="fa fa-check fa-stack-1x"></i>
  </span>
  <span class="fa-stack">
    <i class="fa fa-file-o fa-stack-2x" style="color: red"></i>
    <strong class="fa-stack-1x fa-stack-text text-danger">A</strong>
  </span>
</div>

 

About C.H. Ling 262 Articles
a .net / Java developer from Hong Kong and currently located in United Kingdom. Thanks for Google because it solve many technical problems so I build this blog as return. Besides coding and trying advance technology, hiking and traveling is other favorite to me, so I will write down something what I see and what I feel during it. Happy reading!!!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.