As soon as I hover over my icon to enlarge it, I notice that my entire page starts to

Whenever I hover over my icon, the font size increases causing the div to expand slightly and move the page. This doesn't look great. How can I prevent the div from resizing when hovering over the icon? Here's my code:

<div className="bg-gray-100 ratingWidth tomiddle p-6 rounded-lg text-center">
      Aradığınız yanıtı bulabildiniz mi ?
      <div className="mt-3  space-x-5 h-full "> //My icon Div
        <span className="ti-thumb-up ratingEase "></span> //My icons
        <span className="ti-thumb-down ratingEase"></span>
        <br />
      </div>
    </div>

Css :

.ratingWidth {
  width: 96%;
  height: 100%;
}
.ratingEase {
  transition: 0.2s;
  font-size: 50px;
}
.ratingEase:hover {
  transition: 0.2s;
  transition-timing-function: ease;
  font-size: 54px;
}

Answer №1

To prevent interference with other elements in the DOM, consider positioning the element using absolute positioning. By setting the position property to absolute, you can ensure that your icon will not affect the layout of surrounding elements when moved or transformed.

.ratingEase {
    transition: 0.2s;
    font-size: 50px;
    position: absolute;
}

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

Delaying Text Appearance in React-Native Component

I am currently working on a component that fetches data from an API and displays it on the screen. I would like to find out how I can delay showing the text on the screen until the API call is complete. For example: Your Balance is ____ after the networ ...

Troubleshooting: Running 'npm start' in create-react-app does not start the server on macOS

Recently, I encountered an issue after creating an app with create-react-app. When trying to run the app using 'npm start', the server did not launch despite not throwing any errors. A few weeks back, the 'npm start' command worked per ...

What are the steps for rearranging a table column?

I am trying to show a text file in a table and allocate some code to each entry. I can display the text file. I can assign the code for each record (though this part is still under development). However, I have encountered an issue. The columns of the t ...

Is there a way to allow an HTML page rendered by node.js to communicate back to its corresponding node.js file?

I am currently in the process of developing a registry system using node.js and HTML. However, I have encountered an issue where my HTML page is rendered by node.js, but when trying to call it back to the node.js file, it appears that the JS file cannot be ...

Troubleshooting the Hover Effect of Buttons in Next.js when Using Tailwind CSS for Dynamic Color Changes

Encountering a problem with button hover functionality in a Next.js component using Tailwind CSS. The objective is to alter the button's background color dynamically on hover based on a color value stored in the component's state. This code func ...

In the realm of website design, the IE7 display

I am currently facing an issue with my gallery buttons when using IE7. The CSS code I have for the buttons is causing them to shift to the right hand side of the gallery, even though they work fine in other browsers. Here is the code: .prv_button{ flo ...

Next.js presents a unique problem with double rendering that developers must be

My current issue involves double rendering in my Next.js application. Running next 13, whenever I use next dev, the page is always rendered twice: // The project is simply the result of creating a `create-next-app` // pages/index.js import { useEffect, use ...

Dealing with checked input type='checkbox' in React - A guide

Having a set of checkboxes, some already checked and some to be updated by the user. The issue here is that while the checkboxes render correctly initially, they do not change upon clicking. The 'checked' value does get updated when onChange is t ...

Struggling to implement JSS hover functionality in a project using React, Typescript, and Material UI

I am a newcomer to the world of React/Typescript/Material UI and I am trying to understand how to work with these technologies together. While researching, I came across a similar question related to using hover with Material-UI. However, the syntax was d ...

Scrolling horizontally to display dynamic columns based on a search query in AngularJS

I am facing a challenge with implementing search functionality in a table that has multiple dynamic columns with a horizontal scrollbar. The goal is for users to be able to search for a specific column name or data, and if a match is found, the scrollbar s ...

Fill up the table using JSON information and dynamic columns

Below is a snippet of JSON data: { "languageKeys": [{ "id": 1, "project": null, "key": "GENERIC.WELCOME", "languageStrings": [{ "id": 1, "content": "Welcome", "language": { ...

How do you insert a button into a table using react and coreui?

I have implemented a table to display some data: The data is being displayed properly. My goal is to add a remove button on each row of the table. When the button is clicked, an onClick function should be executed to send a remove request to the server a ...

The positioning of the menu icons varies

When it comes to displaying the search icon in the WordPress toggle bar, I use a custom JavaScript file. This setup is mainly focused on website design and menu functionality. Additionally, I have integrated a newsletter subscription plugin for managing su ...

Various objects are becoming engaged and chosen instead of a single item being focused on

In my React application, I have integrated a searchable Semantic UI dropdown. The issue I am encountering is that when I select an item by typing in the search field, the element matching the search text gets the class "active" and the element at the index ...

What is the best way to handle various sections with changing structures within a complex form using react-hook-form?

I am working on a complex form that has sections A, B, and C, each of which can be in shape A1 or A2, B1 or B2, C1, or C2. Users are required to fill out settings based on whether the section is set to "advanced" or "basic". I want users to submit the enti ...

What is causing the data in the hierarchy table to be invisible?

I am attempting to build a hierarchical table using Vue.js as the foundation. However, I want the table to remain hidden with no data displayed. The issue seems to be within this section of code: <tr v-if="item.childrenVisible" v-for="chi ...

CSS can be used to eliminate specific background images from a webpage

In the CSS code, I have specified two background images within a 'body' tag. #body { background: url("image1.jpeg"), url("image2.png"); background-repeat: no-repeat, no-repeat; } But now, I need to remove only "image1" from a specific p ...

Enzyme is failing to simulate a keydown event on an element when the event is added dynamically to the element

I have successfully implemented a component and now I am in the process of creating tests using jest and enzyme. const handleEvent = (e: KeyboardEvent) => { if(e.keyCode === 27) console.log('Escape event'); } const Component = () =& ...

What is the best way to cut out a portion of a div using CSS?

I have a scaled down version of my project, but it's not quite what I need. I would like the green div to have some transparency so that the content behind both divs is visible (there is none in the example, but there is in my actual project). However ...

Customize the appearance of buttons and tabs located in the header section

Front end development is new to me and I'm trying to learn, but I've hit a roadblock. I have 4 components - 2 buttons and 2 tabs that I want to style in a header at the top of the page. Specifically, I want one button on the top left with padding ...