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

How to Spin an Image in the Canvas Using HTML5

I am having trouble rotating an image inside a canvas after researching similar questions on Stack Overflow. Here's what I've learned: It seems I cannot rotate a single object inside the canvas. I can only rotate the entire canvas itself. ...

Effortlessly manage multiple APIs all in one page using STRAPI

I'm currently in the process of designing a landing webpage that will feature various "content_types," such as templates, including TESTIMONIALS, REVIEWS, RATINGS, AboutUs, and several other sections. Within STRAPI, we have separate APIs for testimon ...

Experiencing problems with the calling convention in JavaScript

Here is a snapshot of the code provided: If the function testFields at Line:3 returns false, then the program correctly moves to Line:21 and returns the value as false. However, if testFields returns true, the program proceeds to Line:4, but instead of ex ...

Enhance user experience with jQuery UI sortable and the ability to edit content in real

I am facing an issue with jquery sortable and contenteditable. The problem arises when I try to use jquery sortable along with contenteditable, as the contenteditable feature stops working. After searching on Stack Overflow, I found a solution. However, up ...

Troubleshooting a Non-Responsive React onClick Event in ES6

I am a beginner in React and have been searching on various platforms like StackOverflow and the internet, but I cannot figure out why onClick is not working in my case. When I click the button, absolutely nothing happens. I have tried everything from putt ...

Stop any additional subscriptions if the current one has not yet been completed using Redux-Observable

I'm currently working on an exciting action that retrieves company data from a local server. This action is triggered in the componentDidMount method of a React component. Upon receiving the data, I create models and send them to the reducer to be pro ...

I am currently engaged in a Portfolio project, where my objective is to ensure that all images are optimized for responsiveness

While Bootstrap ensures that relative images are responsive, absolute images may not be. This can cause alignment issues when the browser window is resized on mobile devices. .title-img { position: relative; width: 100%; height: 100%; } .skill-b ...

Implement a callback function in React using hooks after changing the state

Back in the days of React before hooks, setting state and calling a function after it had been set was achieved using the following syntax: this.setState({}, () => {//Callback}) Now, with hooks, what is the equivalent way to achieve this? I attempted ...

Utilize React Material to ensure the table is well-suited for the page

I am looking to create different subpages: Here is a complete code example: https://stackblitz.com/edit/react-qvzw66?file=src%2FBusinessDetails.js Main page: const useActiveAccountStyles = makeStyles(theme => ({ root: { display: 'flex&apos ...

Top-notch java tool for caching and minifying dojo, jquery JavaScript, and CSS files

In our project, we have downloaded the Dojo and jQuery libraries from Google CDNs. I am currently seeking a Java tool that can both cache and minify these libraries. The caching process should take place within the ROOT project of Tomcat. While I am awar ...

React client side componentDidMount function encountering issues (server side rendering)

Greetings to the Stackoverflow community Apologies in advance if my explanation is not clear enough When a user directly types a URL, the server makes a request, fetches the corresponding data, and renders it on the screen flawlessly. However, when a us ...

Display a fresh <p> tag when the condition in the if-statement is met

If you are looking for a questionnaire, check out this one. Now, I am interested in creating if-statements using HTML/CSS/jQuery to achieve the following scenario: Initially, only Question 1 will be visible. When the input matches a certain value like X, ...

Implementing HTML tags in C# code

Below is an example of HTML script: <h1> This is heading one </h1> <p> This is paragraph. </p> I would appreciate any recommendations on how to add <html></html> tags to the above script using C#. ...

Setting up stylelint for SCSS styling

Currently, I am working on setting up stylelint for my sass project. Here's how my .stylelintrc is structured: defaultSeverity: warning extends: - stylelint-config-standard - stylelint-config-recommended - stylelint-config-sass-guidelines ...

What is the best way to customize the MenuProps of Material UI Select component using createTheme?

I'm trying to update the dropdown menu style of my Material UI Select component using createTheme, but I'm having trouble getting it to work. Here is the code I have so far. Can you spot what might be causing the issue? import { createTheme } fr ...

Obtain the real-time inventory quantity of the specific product variation in WooCommerce

When a WooCommerce product variation's stock quantity is 0 or less and backorders are allowed, I want to offer customers the option to pre-order the item on the product page. To clearly indicate this to customers, the "Add to Cart" button should chan ...

Stingray Riverbed SteelApp, showcasing an image on a maintenance landing page

We have implemented a feature on riverbed stingray that displays a maintenance page whenever the system administrator needs to update the application. In order to achieve this, we designed a custom HTML page with a logo image and uploaded both the .html an ...

What steps should be taken to secure the routes within a React application that is dependent on Firebase for its backend operations

I'm looking for a quick way to secure the routes and manage user roles, authorisation, and authentication within a React website. I need to control which buttons on the AppBar are visible based on the user's role, but so far querying the database ...

How to use bootstrap to resize and center a div element

I'm struggling with formatting a form that is enclosed in a bordered fieldset. Currently, all the form fields are filling the entire width of the fieldset. However, I want certain textfields to be shorter and centered within the fieldset. I have attem ...

Getting rid of the InputLabel transformation in Material-UI

Is there a way to remove the default transformation of InputLabel within a FormControl without needing to override each property individually? I am looking for a solution that completely removes these properties instead of overriding them with new values. ...