Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font Awesome Image Overlay

I'm currently creating a image gallery (using Zurb Foundation as Framework) and would like to show the zoom icon on image hover (like this example here: http://codepen.io/Twikito/pen/Jeaub). But I would like the icon to be a font (Font Awesome) icon and not just one but 3 individual clickable icons.. Would that be possible?

like image 753
Paranoia Avatar asked Mar 06 '13 14:03

Paranoia


People also ask

How do I overlay two font awesome icons?

To stack multiple icons, use the fa-stack class on the parent HTML element of the 2 icons you want to stack. Then add the fa-stack-1x class for the regularly sized icon and add the fa-stack-2x class for the larger icon. fa-inverse can be added to the icon with the fa-stack-1x to help with a knock-out looking effect.

How do I overlay image icons in CSS?

To overlay two elements, one approach is to make a parent position: relative , and then the overlay position: absolute . In this case, this example should work, where the download icon can be any element, such as a bootstrap button. Show activity on this post.

What is FA-stack-2x?

fa-stack-2x. Used on the icon which should be displayed larger when stacked. fa-inverse. Inverts the color of the icon displayed at base size when stacked.

How do I display an image as an icon in HTML?

To insert an icon, add the name of the icon class to any inline HTML element. The <i> and <span> elements are widely used to add icons. All the icons in the icon libraries below, are scalable vector icons that can be customized with CSS (size, color, shadow, etc.)


1 Answers

I've put a quick JSfiddle together using font-awesome. The CSS is hacked together but demonstrates what's possible. It should give you a starting point to experiment with.

<a href="#" title="" class="image">
  <img src="http://www.lyricis.fr/wp-content/uploads/2010/04/kickass-film-still-01.jpg" alt="">
</a>

<div class="cn">
   <div class="inner">
      <a href="#zoom"><i class="icon-zoom-in large"></i></a>
      <a href="#download"><i class="icon-cloud-download large"></i></a>
      <a href="#comment"><i class="icon-comment large"></i></a>  
   </div>
</div>

Note: The JSfiddle above uses font-awesome.css called externally from bootstrapcdn.com

like image 154
nickhar Avatar answered Sep 28 '22 06:09

nickhar