this my code.how to show text message inside the square box with size 1x.

<span class="fa-stack fa-5x" style="margin-left:5%">
 <i class="fa fa-square-o fa-stack-2x"></i>   
</span>

this is my fontawesome square box

有帮助吗?

解决方案

put position absolute and put margin as per your requirement on the div tag you create in which you put the text.

<div style="position: absolute;">asdasdaddas</div>

其他提示

Let the Font Awesome classes do the work. Wrap your text in the fa-stack-1x class and it will position and center it over the icon. You can play with the font size from there if needed.

<span class="fa-stack fa-5x fa-lg">
  <i class="fa fa-square-o fa-stack-2x"></i>
  <span class="fa fa-stack-1x">Aa</span>
</span>

http://jsbin.com/pisadulufo/1/edit?html,css,output

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top