What steps should I take to resolve this animation issue?

My objective with this card animation is for the cards to expand in size when hovered over. Unfortunately, the current issue is that when one card is hovered over, all the other cards also expand, which is not the intended behavior. I am seeking a solution to ensure that only the card being hovered over increases in size, while the others remain unchanged.

HTML:

<div class="card-container" style="margin-top: -25rem; gap: auto">
  <div class="card  col-lg-2 col-md-6 col-sm-12 col-12">
        <div class="img">
                    <img src="img/logoalpinestars.png" alt="logo alpinestars" style="transform: scale(0.2);">
                </div>

                <div class="content">
                    <span class="desc text-white">A Alpinestars, criada em
                        1963, é a marca líder
                        mundial em tecnologia de
                        proteção paira prática de
                        esportes à motor. A
                        empresa acredita que o
                        melhor design é fruto do
                        aprendizado obtido sob
                        condições extremas.</span>
                </div>

                <div class="arrow">
                    <span>&#8673;</span>
                </div>
  </div>

  <!-- more card elements here -->

</div>


css:

.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 20px;
}

.card {
  border-radius: 16px;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  cursor: pointer;
  width: calc(25% - 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(#b8b4b4, #b8b4b4);
  transition: all 0.5s;
  margin-bottom: 20px;
}

.card:hover {
  background-image: linear-gradient(#080434, #080434);
}

.card .img {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  background-size: cover;
  background-position: center;
  transition: all 0.5s;
  z-index: 2;
  position: relative;
  opacity: 0.8;
}

.card .img span {
  text-transform: uppercase;
  font-size: 24px;
  font-weight: 100;
  font-style: italic;
  transition: all 0.5s;
}

.card:hover .img {
  width: 110%;
  opacity: 1;
}

.card:hover .img span {
  font-size: 28px;
}

.card .content {
  padding: 0px 20px;
  height: 0;
  opacity: 0;
  transition: all 0.5s;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  transform: translateY(30px);
}

.card:hover .content {
  height: 260px;
  padding: 20px;
  opacity: 1;
  transform: translateY(0);
}

.card .content p {
  margin: 0;
}

.card .content .title {
  font-size: 20px;
  font-weight: 600;
}

.card .content .desc {
  font-size: 14px;
  font-weight: 100;
  opacity: 0.8;
  margin-top: 8px;
}

.card .arrow {
  padding: 15px;
  transform: rotate(-180deg);
  transition: all 0.5s;
}

.card:hover .arrow {
  transform: rotate(0);
}

.card .arrow span {
  font-size: 24px;
}

After attempting to use different classes for each card to enable individual animation, the issue persists

Answer №1

Include transform:scale(1.1); in your card:hover styling.

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

Display the delete message URL according to the user's name

I have a wall message system using PHP and jQuery where messages from all users are displayed. Now, I want to add delete functionality to each message, but the delete link should only be visible to the user who posted the message. .childs { opaci ...

Getting rid of the scrollbar in Internet Explorer

Instead of just removing the scrollbar, I want to ensure that scrolling capabilities remain intact. This is important because I want to create a 'slide show' effect on the website where users can click 'next' and scroll through content ...

Using Node.js to send instructions to an HTTP server in order to highlight or add color to specific elements within

I have set up a server that receives data from a gaze sensor, as well as an HTTP server that serves an HTML page. I am looking for a way to dynamically highlight elements in the HTML based on the incoming data. Any suggestions on what resources or techniqu ...

Selecting a variety of shapes from a painting

Within my canvas, there are various shapes like ovals, triangles, and squares. I am curious to know if it is possible to obtain a reference to one of these objects and animate it whenever a specific event occurs. Appreciate your attention to this query. I ...

Utilize CountUp.js to generate a dynamic timer for tracking days and hours

I am looking to create a unique counter similar to the one featured on this website https://inorganik.github.io/countUp.js/ that counts up to a specific number representing hours. My goal is to display it in a format such as 3d13h, indicating days and hour ...

Display or conceal a div based on the size of the screen using HTML and CSS

Hey there, I recently finished my first React Project and I’m wondering if there’s a way to hide the 'side-menu' section on mobile screens using CSS. Any suggestions? <div className='side-menu'> <SiderComponent /> < ...

Selecting specified elements in Jsoup using CSS selectors

Check out this HTML snippet: <div class="last-minute"> <span>Modulo:</span>4-3-3<p>Mandorlini is hopeful to have Juanito Gomez and Cirigliano back in action after the break. There's no need to worry about Hallfredsson who was ...

Create a heading for the selection menu

I need to customize a dropdown list on my page so that the text "Select Language" is always displayed to the user, regardless of whether they make a selection from the dropdown. Even if the user chooses "Option 1" or "Option 2," the default text should sti ...

Running JavaScript code along with HTML elements extracted from a jQuery ajax callback

Alternatively, not exactly "executing," but rather updating a pre-existing function with a function returned in the response. Step 1 I have an HTML5 page detailing a specific location. The server-side includes a ColdFusion file called "MapFunction.cfm" ...

Switching the favicon to utilize the favicon.ico file

After initially adding a favicon to my HTML page, I attempted to change it to a different one. However, the first favicon seems to be stuck and won't move, even after removing the link tag entirely. I created a new favicon (favicon.ico) and tried impl ...

What is preventing the items inside the <ul> element from displaying?

Struggling to grasp pagination, I can't figure out why the contents of "li" under the "ul" disappear while the "ul" container continues to display despite specifying in the JavaScript that only 6 should be visible on the page. The "ul" and "li" elemen ...

Implementing CSS keyframe animations in a customized Material UI component using React, Material UI, and JSS

I'm facing an issue with adding a CSS keyframe animation to my Material UI custom styled component. Whenever I try to add a keyframe animation, it throws an error in my code setup: const PulsatingCircle = styled("div")(({ theme, }) => ( ...

Ways to move to the next line following the navigation bar text

Below is the code snippet that I am working with: <nav class="navbar navbar-expand-sm navbar-dark "> <div class="container-fluid"> <a class="navbar-brand" href="#">LOREM IPSUM</a&g ...

The responsiveness of Angular Material appears to be limited when tested in Chrome's debug mode for different devices

I have come across a peculiar issue. Within my HTML file, I have defined two attributes: Hide me on small devices Hide me on larger than small devices When I resize the window, the attributes work as intended. However, when I enter device debug mode ( ...

Turn off HTML display for Internet Explorer users

I am looking to implement code that will block certain pages for Internet Explorer users, making it accessible only for Google Chrome and Firefox users. Do you have any suggestions on how I can achieve this or if there are existing solutions available? I& ...

What is the process for incorporating the !important declaration into a CSS-in-JS (JSS) class attribute?

I'm currently exploring the use of CSS-in-JS classes from this specific response in conjunction with a Material UI component within my React project. In order to override the CSS set by Bootstrap, I've decided to utilize the !important modifier. ...

Button with a Jquery icon design

Hello, I am currently working on implementing an icon button that can collapse and expand text. Although I have successfully implemented the logic for collapsing/expanding, I am facing difficulties in creating the actual icon button. The theme I am require ...

Troubleshooting issues with Bootstrap's responsiveness configuration

I've been working on creating a responsive user login page using Angular 5. It looks great on full-screen display. https://i.sstatic.net/YQrL5.png However, when I resize the browser window, the responsiveness seems to break. https://i.sstatic.net/4 ...

What could be causing the combined width of the children to exceed that of the parent?

Encountered an issue while trying to create a horizontal scroll using inline-flex. Unable to add padding around the scrolling div due to inconsistencies in child widths causing unexpected behavior. To further investigate and understand the problem, visit ...

Height problem with Semantic UI cards in Chrome on Windows

Encountering an issue specific to Chrome on Windows where the height of my .card elements is not displaying correctly. The height appears to be either too much or too little, causing the problem shown in the screenshot below. This issue seems to be isolate ...