Twist two images in opposite directions around the avatar picture using CSS

Upon hovering over the central image, I want two circles to animate in opposite directions simultaneously. So far, I have only been able to animate them separately by individually hovering over the objects.

This is what I'm aiming for:

Check out my CodePen demonstration: http://codepen.io/beng_beng/pen/Azstr

Answer №1

It's recommended to utilize the :hover pseudo-class on the a#rotator element:

a#rotator:hover > img{ 
 -webkit-transform: rotate(-360deg); 
 -moz-transform: rotate(-360deg); 
 -o-transform: rotate(-360deg);
 -ms-transform: rotate(-360deg); 
}

a#rotator:hover span img{ 
 -webkit-transform: rotate(360deg); 
 -moz-transform: rotate(360deg); 
 -o-transform: rotate(360deg);
 -ms-transform: rotate(360deg); 
}

View Demo.

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

Issue with Global styles causing conflicts with Grommet styled-components styles

I attempted to update my current App to utilize Grommet for the Inputs. The transition went smoothly, but I encountered a problem with the styles. Because the react-App is embedded on various pages, I have to contend with various types of global css style ...

Is it possible to make the body background image adjust its size to the browser window

Looking to change the body background using a jQuery script. The goal is to scale the background image to fit the browser window size. I've come across a script called , but it seems to affect the class img and not the background-img. Any suggestions ...

The bottom row of elements is aligned to the left in a grid that is centered

Within a div with text-align:center, I have multiple same-size blocks set to display:inline-block. | _____ _____ _____ _____ | | | | | | | | | | | | | 1 | | 2 | | 3 | | 4 | | | |_____ ...

How to position an image in a carousel using Bootstrap 3 CSS

I am currently customizing a bootstrap carousel example by adjusting the CSS code to ensure that the center of larger images aligns perfectly in the middle of the carousel. Here is the code snippet I am working with: .carousel-inner > .item > img { ...

Bootstrap 4: Spacing between columns within a row

This design is almost complete, but I am facing difficulties in adding gutters between column divs in a row (on the right side, green). Additionally, configuring the width of the div that holds all the rows (blue) is proving to be challenging. You can find ...

What could be causing the ReferenceError in JSFiddle saying that the function is not defined?

Here is the code I have on jsfiddle: https://jsfiddle.net/oscar11/1xstdra1/ After running the script on jsfiddle, I encountered an error in the console: ReferenceError: doPagination is not defined. Surprisingly, when I tested it on my localhost, it worked ...

Issue with displaying jQuery class names accurately

I am implementing jquery.scrollablecombo.js for a dropdown menu using jQuery. However, when I include it in my HTML code, the class attribute is displayed as "classname" instead of "class." See the example below: <div classname="searchBar cb_selectMain ...

Dragging an image within a div using JQueryUI

Something strange is happening with my code. I am utilizing JQueryUI to enable dragging of div elements that contain an image tag. The issue arises when I start dragging the div - the image, which was perfectly centered within the div while stationary, now ...

Guide on making an SVG tooltip using the Menucool JS extension

I am trying to add a simple tooltip to an SVG "map" when the mouse hovers over a rectangle. To create the tooltip, I would like to utilize this specific plugin. Here is how I have connected the SVG to HTML: <object data="map.svg" type="image/svg+xml" ...

difficulty with content insertion in asp/css/html

Hi everyone, I seem to be experiencing an issue with my content placeholder: Even though my content is supposed to be inside the placeholder in my ASP code, it appears outside: <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"& ...

What is the best way to apply maximum height to an element using CSS?

Looking for help with my website: I made some changes in the code using Firebug and identified these elements that I want to modify (but changes are not live yet) The following code represents the elements on my site: This is the HTML code: <di ...

My confusion is running high when it comes to navigating the mobile version of my website

Creating a navigation bar for my website has been challenging. Whenever I switch to mobile view, the list in my navigation bar shifts 40px to the right side of the screen where there's nothing. Is there any way you can assist me with this issue? ...

Is there a reason the hr tag elements aren't extending to the full width within the list?

I am having trouble with my hr tag elements in the table I created - they are not spanning the full width like the line above them. I have tried adjusting the width property but it doesn't seem to be working. Can anyone offer advice or guidance on how ...

The functionality of the star ratings is not working properly when attempting to click on them

I am encountering an issue with my rating system code that uses Font Awesome stars in a form. When I click on it, the system does not function as expected. My goal is to adjust the code so that the rating system works accurately upon clicking. Below is th ...

Setting the line-height property in CSS to a value greater than the font-size property

Dealing with a frustrating issue where I want to align the top of an image with text, but the letters end up slightly below the line height. Check out this simple example featuring a classic movie: HTML: <img src="http://cf2.imgobject.com/t/p/w92/wcI ...

Achieving a bold border on top of an image without altering the image's dimensions

I'm in need of Photoshop-like selection functionality, but when I add a border to the enclosing div that holds the image, the image ends up smaller by twice the thickness of the border. How can I fix this issue? I have attempted a solution by adding ...

Tips for concealing a div when clicking on an element solely with CSS

I am currently working on creating a CSS Main Menu in Vue. The functionality is such that it pops up when the mouse hovers over it, and hides when the mouse moves out. However, I am facing an issue with hiding the menu when clicking on a hyperlink a. Any s ...

Transforming an external PHP script into an internal function

I am facing a challenge with my current external PHP script (resize.php) that I use to resize or thumbnail images. I want to transform this script into an internal function within other PHP scripts, but I'm unsure of how to approach this conversion. ...

What is the best way to switch between components when clicking on them? (The component displayed should update to the most recently clicked one

I am facing a challenge in rendering different components based on the navbar text that is clicked. Each onclick event should trigger the display of a specific component, replacing the current one. I have 5 elements with onclick events and would like to re ...

Displaying elements side by side on larger screens and centered on smaller screens

Is there a way to arrange elements next to each other on wider screens, aligning them left and right, while also centering one above the other on narrower screens? Preferably without using media queries: ...