Modify the standard placement of choices in MUI

Currently, my UI is powered by MUI.
I have various options displayed in the image below:

https://i.sstatic.net/YKoyV.png
Everything looks good so far. However, I wish to reposition the options container further down. (It is currently set at top: 64px which is the default).
I aim to change it to top : 100px. Once adjusted, it will appear as follows:

https://i.sstatic.net/s20yS.png

I attempted to implement this change using CSS, but it didn't take effect.

const useStyles = makeStyles((theme) => ({
  userAge: {
    "& .Mui-focused": {
      "body .MuiPaper-root": {
        top: "100px !important" // 64px is default
      }
    }
  }
}));
//jsx return

<FormControl fullWidth className={classes.userAge}>
// more code here        
</FormControl>

You can also experiment with it here: https://codesandbox.io/s/funny-shannon-h6flch?file=/demo.tsx

Note :

I prefer not to globally set top : 100px.

Answer №1

I have made some updates to your codesandbox. Hopefully, these changes will be helpful for you ;)

To style the menu, you can utilize the MenuProps and then apply class-based styles to the paper element.

Check out the updated version here!

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

Parallax scrolling in all directions

Is there a resource available for learning how to program a website similar to the one at ? I am familiar with parallax but can't seem to find any examples that resemble what they have done on that site. ...

The CSS stylesheets are not compatible with IE7 and IE8

I am encountering an issue with my local site where the CSS links are not being included in the page, particularly in IE7 and IE8. The technologies I am using include WordPress 3.6, Bootstrap 3, Modernizr, and jQuery. Source Code <!DOCTYPE HTML PUBLI ...

How to center multiple divs in a row using HTML and CSS

I've been attempting to achieve a pretty basic task, but unfortunately my efforts have fallen short thus far. I have an image and a title that need to be centered within their parent div element. However, I'm struggling to find the proper way to ...

Incorporating a Drawer and AppBar using Material-UI and React: Dealing with the error message "Unable to access property 'open' of null."

Currently, I am working on developing an app using React and Material-UI. I have successfully implemented the AppBar component, but I am facing difficulties with setting up the Drawer functionality. The main issue I am encountering is an error message sta ...

Methods like jQuery blink(), strike(), and bold() offer dynamic ways to manipulate

I'm currently tackling an inquiry. The code I crafted seems to be functioning without any issues: (function () { if($('#target:contains("bold")')) { $('#target span:first').css('font-weight','bold ...

What could be causing the responsive grid to not stack items properly?

I'm struggling to make my page responsive on mobile devices. The elements are not stacking as intended, but rather aligning side by side. How can I fix this issue? My attempts to adjust spacing, padding, and flex-grow values have not yielded the desi ...

The React-tooltip feature is showing up twice on the screen when a Material-UI

Every time I include a tooltip in an SVG (using react-tooltip), the tooltip appears twice: https://i.sstatic.net/Zmlx4.png The Code: <HelpIcon data-tip='This field represents all sales (or revenues) generated by the company.'></HelpIcon ...

Strange Behavior of HTML5 Audio Elements

I'm currently in the process of designing a shop website with a nostalgic Windows98 theme. On the product's page, I want to include a preview of audio. Here is the CSS code that I have used for the HTML5 audio element: audio::-webkit-media-contr ...

Trouble with Material UI transition causing onExit to not function as expected

I am currently working with a snackbar component in my application: const handleExited = () => { console.log('snackbar exited'); }; const slideTransition = (props) => { return <Slide {...props} direction='right' onEntere ...

I am facing an issue where the display property of inline-block is taking precedence over

I am facing a challenge in placing 2 containers side by side. These containers have a thick white border and are initially hidden until a click event reveals them. The containers are given a class of "hidden". However, in order to align the div containers ...

Seeking a template for a server-side programmer who lacks proficiency in CSS and design?

Hey there all you wise folks! So here's the deal - I'm a PHP/JavaScript wizard when it comes to logic and server-side stuff, but I really suck at design, CSS, and all things arty. Does anyone have any recommendations for a template or tool that ...

Do the last block in the table occupy the remaining space in the row?

Trying to create an HTML email calendar and struggling with getting the last td to fill the remaining space without affecting the width of other rows. Is there a way to increase the width of just the 4th block on the last row to fill the empty space? Here ...

The issue with two different link styles displaying correctly in Internet Explorer but not in other browsers is that when a link is clicked, all links appear

Looking for a testing ground? Check out my website: While everything works smoothly on IE, I've noticed a glitch in other browsers. Clicking on one link causes all links on the page to appear as visited links. Take a look at the CSS code below: @ch ...

Step-by-step guide to successfully loading the MUI Material-UI Blog template in Vite

I inserted the Material MUI example into StackBlitz using ViteJS. After that, following the README.md for the Templates > Blog section, it stated: Copy the provided files into your project, or one of the sample projects. Ensure that your project has t ...

Incorporating a CSS file within a JSP page

I've been struggling to get my '.jsp' file to utilize a '.css' file that I created. Initially, I stored the '.css' file in the 'WEB-INF' folder but discovered that this folder is not accessible publicly. So, I m ...

The download attribute is not functioning properly on both Chrome and Edge browsers

I've been trying to use the download attribute, but it doesn't seem to be working. I have also attempted to use the target attribute to see if there are any issues with downloading from the server or from a web (https) source. Unfortunately, noth ...

Cover any HTML element with a translucent overlay box

I have a unique problem with an HTML file that is out of my control when it comes to its content. My only option is to inject a CSS file and/or JavaScript (potentially using libraries like jQuery) into the mix. Within this HTML, there are elements that re ...

Assign a background image to a master page utilized in subdirectories

In my website's root directory, I have a master page. Inside this root directory, there is a folder named Images which contains the background image for my master page. When I apply this master page to web pages located in the root directory, everythi ...

Hide a div when multiple classes are filtered using jQuery

I have several divs with the class .item. When the user clicks on the Classfilter submit button, all .item elements that also have at least one class from the dateClasses array (for example ['28.09.2015', '29.09.2015']) should be hidden ...

Functionalities of HTML controls

I currently have a select element in my HTML code which looks like this: <select> <option id="US" value="US"> </option> <option id="Canada" value="Canada"> </option> </select> My requirements are twofold: ...