0

I am trying to add a user icon to my header. bootstrap is adding more icons than what my code calls for, what is going on? Thanks in advance!

<ul class="nav pull-right">
 <% if user_signed_in? %>
   <li><%= link_to "Edit Profile", edit_user_registration_path %></li>
   <li><%= link_to "Logout", destroy_user_session_path, method: :delete %></li>
 <% else %>
   <li><%= link_to "", new_user_session_path, class: "icon-user" %></li>
 <% end %>
</ul>

http://i.minus.com/i7krj72G9Gmsd.png

i am using the responsive navbar btw.

DhatchXIX
  • 437
  • 1
  • 3
  • 17
  • 1
    Have you checked the size of your links? Its possible the height is bigger than required and hence showing 2 icons. – Sagar Patil Apr 25 '13 at 14:30
  • I am not sure what the height of my links are nor do I know how to change it. My best guess is that its the default size from bootstrap. – DhatchXIX Apr 25 '13 at 14:41
  • Do you have a Fiddle or link I can view? Basically if you open up the Firebug or Dev tools and insepct your links, you can set the height or line-height to match the size of a single icon. Bootstrap icons are 14x14 pixels so if you set the height of your links to 14px, it should fit a single icon. You can add a class to your links and add the height in the CSS. – Sagar Patil Apr 25 '13 at 14:46
  • you can view the page here [link](http://still-tor-3256.herokuapp.com/) – DhatchXIX Apr 25 '13 at 15:37

2 Answers2

0

I don't have the bootstrap icons in my rails project to test this, but see if this works:

<%= link_to raw("<i class='icon-user'></i>"), new_user_session_path %>
sicks
  • 757
  • 8
  • 23
0

You can set padding:15px 15px 15px to padding:0 for .navbar .nav>li>a in your CSS.

Sagar Patil
  • 1,938
  • 13
  • 21