How to place a stylish font over an image and recreate hover effects

I am looking to place social media icons below an image next to the photo's title, including Facebook, Twitter, Soundcloud, and Instagram. I want these icons to rotate along with the image when it is hovered over.

HTML

<div class="polaroid-images">          
    <a href="" title="Alex" ><img height="200" src="Alexandra.jpg" alt="Island" title="Alex" class=fishes /></a>
    <i class="fa fa-facebook fa-3x"></i>
</div>  

CSS

.polaroid-images a
{
    background: white;
    display: inline;
    float: left;
    margin: 0 15px 70px;
    padding: 10px 10px 25px;
    text-align: center;
    text-decoration: none;
    -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, .3);
    -moz-box-shadow: 0 4px 6px rgba(0,0,0,.3);
    box-shadow: 0 4px 6px rgba(0,0,0,.3);
    -webkit-transition: all .15s linear;
    -moz-transition: all .15s linear;
    transition: all .15s linear;
    z-index:0;
    position:relative;
}

.polaroid-images a, :after {
   color: #333;
   font-size: 20px;
   content: attr(title);
   position: relative;
   top:15px;
}

.polaroid-images img { 
   display: block; 
   width: inherit; 
}


.polaroid-images a, i:nth-child(3n) { 
    -webkit-transform: rotate(-24deg);  
    -moz-transform: rotate(-24deg); 
    transform: rotate(-24deg); 
}


.polaroid-images a:hover{
   -webkit-transform: rotate(0deg); 
   -moz-transform: rotate(0deg);
   transform: rotate(0deg);
   -webkit-transform: scale(1.2); 
   -moz-transform: scale(1.2);
   transform: scale(1.2);
   z-index:10;
   -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, .7);
   -moz-box-shadow: 0 10px 20px rgba(0,0,0,.7);
   box-shadow: 0 10px 20px rgba(0,0,0,.7);
}

.polaroid-images i { 
   z-index: 11;
   padding 30px 25px 15px;
   margin-right: 10px 22px 30px ;
   position: absolute;
   top: 25%;  
   left: 25%;
   transform: translate(1%, 1%);    
   overflow: hidden; 
}

Answer №1

To create a smooth transition effect on hover for the "i" element, simply add the following code:

.card:hover i {
    -webkit-transition: all .15s linear;
    -moz-transition: all .15s linear;
    transition: all .15s linear;
}

Answer №2

Place the code within the a tag and apply a style similar to how you formatted the :after element containing the image's title.

.polaroid-images a {
  background: white;
  display: inline;
  float: left;
  margin: 0 15px 70px;
  padding: 10px 10px 25px;
  text-align: center;
  text-decoration: none;
  -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, .3);
  -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, .3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, .3);
  -webkit-transition: all .15s linear;
  -moz-transition: all .15s linear;
  transition: all .15s linear;
  z-index: 0;
  position: relative;
}

.polaroid-images a,
:after {
  color: #333;
  font-size: 20px;
  content: attr(title);
  position: relative;
  top: 15px;
}

.polaroid-images img {
  display: block;
  width: inherit;
}

.polaroid-images a,
i:nth-child(3n) {
  -webkit-transform: rotate(-24deg);
  -moz-transform: rotate(-24deg);
  transform: rotate(-24deg);
}

.polaroid-images a:hover {
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transform: scale(1.2);
  -moz-transform: scale(1.2);
  transform: scale(1.2);
  z-index: 10;
  -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, .7);
  -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, .7);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .7);
}

.polaroid-images i {
  position: relative;
  font-size: 1em;
  top: 15px;
  margin-right: .5em;
  color: #3b5998;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="polaroid-images">
  <a href="" title="Alex"><img height="200" src="http://kenwheeler.github.io/slick/img/fonz1.png" alt="Island" title="Alex" class=fishes /><i class="fa fa-facebook fa-3x"></i></a>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Converting a JavaScript function to CoffeeScript, accepting jQuery's .map function and Selectors as parameters

I'm in the process of converting some JavaScript code into CoffeeScript and encountering an issue with a particular function. Here is the original functioning JS: $(".comformt_QA").change(function(){ var array = $(".comformt_QA").map(function() { ...

The Antd Tooltip becomes unresponsive when a component is clicked and moved

Having an issue with a button that has an Antd tooltip, here is the setup: <Tooltip title="Some text"> <button onClick={openNotes}><Icon icon="notes" /></button> </Tooltip> Upon clicking the button, the ...

Angular-nvd3: maintaining consistent spacing between data points along the x-axis

By default, the scale of the x-axis is calculated from values, resulting in uneven distances between two adjacent points. For example, with an array of values like [1,2,5], there will be different distances on the x-axis for each point, and the x-axis labe ...

Changing the size of a div using jQuery

I'm attempting to adjust the size of a div element. You can view my progress in this code fiddle: https://jsfiddle.net/bj3m24ks/31/ Kindly refrain from sharing links to other tutorials as I have already explored them all. I attempted to utilize the $ ...

Challenges in displaying a preview of the cart following a successful ajax request

I'm trying to display a cart preview when hovering over a specific shopbag div. To achieve this, I've created another div called livebag where I run a query to fetch and preview the cart items stored in the database. Initially, the livebag div is ...

The issue at hand is that one of the JavaScript buttons is functioning properly, while the other is not playing the video as intended. What steps can

I've been working on a script for my school project website that should make buttons play videos, but I'm running into an issue where it only works for the first button (btn). Programming isn't my strong suit, and I put this together based o ...

Sending Data Between Web Applications in JavaScript

Currently developing a take-away application using AppLab, which uses JavaScript. Due to the limitations of modifying HTML code in AppLab, I had to utilize an external web app for the checkout process (unable to integrate PayPal buttons in AppLab). When th ...

The event for closing the React Select MUI dropdown does not trigger when selecting multiple options

When multiple values are selected from the dropdown and clicked outside, the dropdown closes but the onClose event fails to trigger. I need to filter data based on the selections made in the dropdown. For example, looking at the image below, I want to dis ...

Having trouble with CORS in your Angular application?

I am attempting to retrieve data from a site with the URL: Using the $http service After extensive research, I have come up with this CoffeeScript code snippet: angular.module('blackmoonApp') .controller 'PricingCtrl', ($scope, $ht ...

The message "In Angular, there is no such property as 'data' in the type '{ user: User; session: Session; error: ApiError; }'."

Here is my complete supabase.service.ts code: import { Injectable } from "@angular/core"; import { createClient, SupabaseClient, User } from "@supabase/supabase-js"; import { BehaviorSubject } from "rxjs"; import { envi ...

Generating unique ID's for data posting in PHP and JavaScript

I've developed a dynamic form that includes an "add more" button to generate an XML file for data import purposes. Users can fill out the form and add as many entries as needed by clicking on the "add more" button. The inputted data is then processed ...

The flex reverse-column child's text selection occurred in the incorrect direction

I am having an issue with selecting text in a flex container that is set to reverse column. The selection I make is incorrect because the browser tries to select from the end of the element, resulting in improper selection. For example, <div style=" ...

The jQuery message validator is currently experiencing some issues with its functionality

I am working on implementing a basic login system using jQuery and it appears to be functioning correctly, but I keep getting an error message in my jQuery code here: alert('Error in system');. What's puzzling is that when I use alert(answe ...

The combination of Google Maps and CSS transforms causes a blur effect on the page

After implementing the CSS Transform technique to center a div both horizontally and vertically, the desired effect was achieved. However, an unexpected issue arose on pages that contained a Google Maps iframe causing the entire page to go blurry. To view ...

Can $refs cause issues with interpolation?

I'm currently learning Vue.js and the course instructor mentioned that modifying the DOM element using $refs should not affect interpolation. In fact, any changes made directly to the DOM will be overridden by interpolation if it exists. However, in m ...

The Jquery .change() function refreshes the results just once

I am working on a form with 3 input fields named #first, #second, and #third, along with a fourth field labeled as #theResult. <div id="addFields"> <span id="addFieldsHeader">Add The Fields</span> <table style="margin:0 auto;"> ...

No reaction when utilizing the .post() method in jQuery

I've set up a basic form for users to update their status message. The form is functioning properly, but I'm encountering an issue where I am not receiving any response upon submission (using firebug, the response after submit is empty). Below i ...

How can I prevent div duplication when working with ui-router?

I created a basic demonstration to get familiar with ui router. Unfortunately, I encountered an issue of duplicated views when utilizing ui router. Below is the snippet of the stateProvider section: app.config(function($stateProvider,$urlRouterProvider) ...

Adding a class to the following DIV and smoothly transitioning the current one out can be achieved using a dynamic number of items in multiple instances

Is there a way to create a scalable CSS slideshow for text divs without using images? Here is the current HTML structure: <div class="mb-panel-container cf"> <div class="mb-panel-section mb-slider"> <div class="mb-panel active" ...

transferring data from grails to javascript via a map

I am facing an issue with passing a Map object from my Grails controller to JavaScript. The code snippet in my controller is as follows: def scoreValue = new HashMap<String,String>(); scoreValue.put("0","poor"); scoreValue.put("1","good"); ... retu ...