Struggling to get the Hover feature on Link from Material-UI to function properly

I've been attempting to hover over Link from Material UI, but unfortunately, it's not working as expected. The CSS styles are not being applied for some unknown reason, and I can't seem to figure out why. Additionally, the Button class is also not functioning properly on buttons. I'm currently using the most recent version of MUI.

import {Link , Button} from '@mui/material';
import {makeStyles} from '@mui/styles';

const useStyle = makeStyles({
    MenuItems : {
        '& li' : {
            display : 'inline',
            marginRight : '2rem',
            '&:hover' : {
                color : '#E0475B'
            }
        }
    },
    Link : {
        '&:hover' : {
            color : '#E0475B'
        }
    },
    Button : {
        backgroundColor : '#E0475B' , 
        color : 'white',
        fontSize : '1.5rem'
    }

})

const HomeMenu = () => {
    const classes = useStyle();
    return ( 
        <div className="Body">
            <AppBar style={{backgroundColor : 'white'}}>
                <Toolbar className = {classes.Toolbar}>
                    <div className={classes.MenuItems}>
                        <ul>
                            <li>
                                <Link href = '/' underline = 'none' style={{color : 'black'}} className={classes.Link} >Home</Link>
                            </li>
                            <li>
                                <Link href = '/' underline = 'none' style={{color : 'black'}} className={classes.Link}>About Us</Link>
                            </li>
                            <li>
                                <Link href = '/' underline = 'none' style={{color : 'black'}} className={classes.Link}>Our Mission</Link>
                            </li>
                            <li>
                                <Link href = '/' underline = 'none' style={{color : 'black'}} className={classes.Link}>Contact Us</Link>
                            </li>
                        </ul>
                    </div>
                    <div className={classes.ButtonItems}>
                        <ul>
                            <li><Button variant='contained' className = {classes.Button}>Sign Up</Button></li>
                            <li><Button variant = 'contained' className = {classes.Button}>Log In</Button></li>
                        </ul>
                    </div>
                </Toolbar>

            </AppBar>
        </div>
     );
}
 
export default HomeMenu;

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

Component's state not reflecting changes after dispatching actions in Redux, though the changes are visible in the Redux DevTools

When a menu item is clicked, I execute the following code: import React, { Component } from 'react'; import 'react-dropdown-tree-select/dist/styles.css'; import { connect } from 'react-redux'; import '../../../css/tree.c ...

Ways to position a DIV on the right side of the screen using percentage margin to adjust its distance from the edge as the browser is resized

Allow me to provide a clearer explanation here: Imagine an element placed on a webpage with a margin of 10% from the left side. When the size of the page is adjusted, the margin on the left decreases accordingly - for example, 10% from 1400px - 140px, and ...

Setting the CSS position to fixed for a dynamically generated canvas using JavaScript

My goal is to fix the position style of the canvas using JavaScript in order to eliminate scroll bars. Interestingly, I can easily change the style using Chrome Inspector with no issues, but when it comes to implementing it through JS, I face difficulties. ...

Are there any alternative methods to avoid duplication of Navbar link margin classes in Tailwind CSS?

It feels really repetitive to have to add margin classes to each LI manually on a non-dynamically generated menu. It almost seems as messy as using inline style attributes... Is there a more efficient way to handle this? While it may not be a big deal fo ...

CSS file not loading in an ExpressJS application

I'm facing an issue with my ExpressJS web app where only the HTML files are loading but the CSS rules are not being applied. I have linked the HTML file with the CSS file and also included express.static(path.join(__dirname, 'css')) in my ap ...

After the update, Material UI is causing a TypeError by throwing an error stating that it cannot read the property 'muiName' of an

After updating from "material-ui": "^1.0.0-beta.38" to "@material-ui/core": "^1.3.0", I made changes to imports, ran npm install, removed node_modules and even deleted package-lock.json. However, I continue to encounter the cryptic error message TypeError: ...

The spacing between the rows of the ListItem is excessively tall

Currently, I am working with Material UI to design a list. It seems that the height of my list elements needs to be reduced. I have attempted using <List dense={dense}>, but it appears to still be too spaced out. Is this issue related to padding or s ...

What's the Deal with My Space Transforming into a Fresh Look courtesy of the Material UI Grid System?

I'm struggling with implementing the Material UI Grid system. My goal is simple - I want to place an Icon + Text on the left side of a container and a button on the right side. However, I am facing an issue where text with two words separated by a spa ...

The Bootstrap 4 column is not floating properly to the right as it is leaving a gap on the

My right sidebar is not floating to the right and has space from the right side. You can view it at this link: <div class="col-md-2 col-lg-2 col-sm-2" id="right-sidebar" style="background-color:orange; float: right; right: 0!important; width: 100%;"& ...

Exploring z-indices in event bubbling

JSFiddle: https://jsfiddle.net/uLap7yeq/19/ Issue Let's examine a scenario where there are two elements, canvas and div, positioned in the same location using CSS. The div has a higher z-index compared to the canvas, but how can we make sure events ...

Is there a way to verify if an ID includes more than one word?

I am trying to target a specific div with a unique id in jQuery: <div id="picture_contents_12356_title"></div> The '12356' is autogenerated and must be included in the id. I need to create a jQuery selector that combines "picture_co ...

Tips for making a website display in landscape mode rather than portrait orientation

As a newcomer to web design, I am curious if it is feasible to create a website that automatically rotates to landscape view when accessed on a mobile device. The current project I am working on is fluid in design, so this feature would greatly enhance t ...

Attempting to showcase a button element within a popover, although it is failing to appear

I have implemented a feature where a popover appears when hovering over an inbox icon (font-awesome). However, I am facing an issue with displaying a button on the second row within the popover. The title is showing up fine, but the button is not appearing ...

Make the background disappear when the text field is left empty and the cursor is not present (onUnfocus)

When the text field is empty and there is no cursor in the text field, I want it to be transparent and for the spell checker not working. The result should be displayed a little to the left inside a <div>. Should this be done using CSS, JavaScript, ...

"Enhance your software with a customizable interface or develop new functionalities to generate analogous

Having API data with a similar structure, I am looking to streamline my code by filtering it through a function. However, as someone new to TypeScript, I am struggling to implement this correctly using a function and an interface. Essentially, I aim to ach ...

Video embedded in a plain CSS popup that automatically starts playing even before the popup is triggered

My goal is to incorporate a video into a minimalist CSS modal window, following the guidance provided here. While the setup works well overall, I encounter a issue where the video starts playing before the modal window is opened (I need to maintain the "au ...

Creating a JSX.Element as a prop within a TypeScript interface

I need to create an interface for a component that will accept a JSX.Element as a prop. I have been using ReactNode for this purpose, but I am facing issues when trying to display the icon. How can I resolve this issue? export interface firstLevelMenuItem ...

Prevent the box from closing automatically after submitting a form using jQuery

Despite my efforts to keep a simple dialog box open after submitting a form, it continues to close. I tried using the preventDefault method in jQuery, but it didn't solve the issue. Below is the code snippet: $(document).ready(function(e) { $(&apo ...

What is the most effective method to override parent styles while utilizing CSS Modules?

I'm currently using NextJS along with CSS Modules for styling purposes. One of my goals is to adjust the appearance of a component in different scenarios: When it's rendered normally on a page, utilizing props to specify className modifiers. W ...

Loading state with suggestions from autocomplete feature on React

In my current project, I have a component that consists of input fields and a button. The button is set to be disabled until the correct values are entered in the input fields. Everything works as expected, but there's an issue with Chrome auto-fillin ...