In my React app, I have implemented a category selector with flexbox styling to evenly space the category labels horizontally. I recently made some changes to the hover effects by increasing the font weight of the text on hover. However, this adjustment resulted in the surrounding labels shifting when one label is hovered over. Is there a solution to this issue where the hover effect only affects the font weight without causing any movement in the layout?
Below is the CSS code I am currently using:
.skills-category-selector {
display: flex;
justify-content: space-between;
width: 100%;
margin-top: 12px;
}
.category-label {
cursor: pointer;
font-size: 20px;
font-weight: 500;
}
.category-label:hover {
font-weight: 800;
text-decoration: underline;
}