At 400 pixels screen size, the buttons in the appBar component are spilling out

In my appBar component, I have three buttons that appear fine on large screens. However, when the screen size reaches 400px, they start stretching out of the appBar.

Here is how they look on large screens: https://i.sstatic.net/l3nJM.png

And this is how they appear at 400px:

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

I attempted to remove margins and paddings but it did not solve the issue.

Furthermore, there are no elements causing additional margins. What could be causing this problem?

I created a sandbox to demonstrate the issue: https://codesandbox.io/s/spring-tdd-c1ocm?file=/src/App.js

Answer №1

I suggest incorporating a container element.

import Container from "@material-ui/core/Container";
. . . 
<Container>
 <Button className={classes.button}>English</Button>
 <Button className={classes.button}>Sign up</Button>
 <Button className={classes.button}>Login</Button>
</Container>

It appears to provide better organization. Do you believe this would be beneficial?

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

We couldn't locate the module: Execution error - Unable to locate the file './components/layouts/Navbar' in the '/opt/build/repo/src' directory

Struggling to deploy my react project on netlify as I keep encountering this error message: Module not found: Error: Can't resolve './components/layouts/Navbar' in '/opt/build/repo/src'. Even after attempting deployment on vercel, ...

Initiate Ant Design select reset

I am facing an issue with 2 <Select> elements. The values in the second one depend on the selection made in the first one. However, when I change the selected item in the first select, the available options in the second one update. But if a selectio ...

Is there a way to save a NextJS page as a static HTML file for download?

I am currently working on a website built with Next.js, and one of the pages contains dynamic graphs that update by fetching data from an API. I am looking to add a functionality where users can download the entire page as an HTML file with all the JavaScr ...

Creating double borders in CSS with the second border extending all the way to the top of the element

Can you help me figure out how to achieve this effect using CSS? It seems like a simple task: border-top: 1px solid #E2E2E2; border-left: 1px solid #E2E2E2; border-bottom: 1px solid #848484; border-right: 1px solid #848484; Just add: box-shadow: 0.7px ...

What is the best way to make a DIV box span the entire webpage without overflowing to the left?

I am currently working on a client's website and running into some issues with the layout of the booking page. The address is supposed to be on the left side, the contact form on the right, and both should be contained within a white box that fills th ...

Signing out in React js

Hey everyone! I'm facing an issue. I have to create a logout form on React js that redirects to loginindex.html from hello.ejs and clears some variables using server.js, but I'm not sure how to do it =( Can anyone offer some guidance? Thank you! ...

Understanding the use of `useState` within the lifecycle of a React

I'm eager to dive into the lifecycle of a React functional component. Many resources outline these three key steps: 1-mounting 2-rendering 3-unmounting. But what about other code that is written before the useEffect() function, like this example: ...

Move your cursor over an image to modify the z-index of another image

I am facing an issue with my webpage that consists of 6 small images and one large image in the center, made up of six layers each containing one image, similar to this example: http://jsbin.com/onujiq/1/. I have set the z-index property of all center imag ...

Page flickers when jQuery is used to scroll to an element

One issue I have encountered is with a link that, when clicked, should scroll down to a specific element on the page. However, every time I test this feature, there seems to be an inconsistency where the page may momentarily flash before scrolling as inte ...

Sharing a boolean state between two pages using Material UI components

One challenge I've been facing is passing a boolean useState value between two pages. I found a helpful solution on this Stack Overflow thread: How to call useState from another Page? The main goal here is to display a success alert on a separate pag ...

Managing the rendering of a functional component using React/Redux

I have encountered an issue with my app where it updates too frequently. Within my reducer, there is a specific action called checkTasks. This action essentially scans through the list of current tasks and moves any expired tasks from the main tasks array ...

Choose the grandparent of an element's parent

Is there a way to select the grandparent element of a child in Javascript without having to chain the .parentElement method twice? Specifically, I am looking for a method that can substitute .parentElement.parentElement when selecting the desired element, ...

Ways to adjust Safari printing margins using CSS to achieve borderless printing

I am struggling to eliminate margins when printing a webpage to PDF in Safari. Despite setting the page size to 'A4 borderless' in the print dialogue, Safari on OSX continues to add extra margins around my HTML. Enabling 'print backgrounds&a ...

Exploring the internet using a specific font style and ensuring a

I am facing an issue with the fonts on my website. They work perfectly in all browsers when using http, but as soon as I switch to https, the fonts stop working in IE8 and lower versions. However, they do display correctly in ie9. When trying to access th ...

Is your React Hook experiencing a delayed useEffect firing?

I've been experimenting with utilizing useEffect() within my React hook to ensure the state updates when the props change. However, I've noticed a delay where the useEffect is only triggered after clicking again on an element in my hook. As someo ...

What is the best way to use jQuery to update the color of an SVG shape?

Hello everyone! I'm excited to be a part of this community and looking forward to contributing in the future. But first, I could really use some assistance with what seems like a simple task! My focus has always been on web design, particularly HTML ...

Is there a way to activate a function in one component from another within a Next.js application?

As mentioned in the title, I am working with 2 custom components within a basic NextJS application: <section> <CompA></CompA> <CompB></CompB> </section> I am trying to figure out how to have a button inside Comp ...

Troubleshooting issue with Highcharts 3D rendering after using setState()

When working on implementing a 3d pie chart in React using react highchart, I encountered an issue. Whenever I utilize this.setState() inside the lifecycle method componentDidMount(), the 3d chart shifts from its original position to the right diagonally. ...

When I attempt to incorporate multiple sliders on a single page, I encounter difficulties in determining the accurate stopping position if the number of slides varies

I am having trouble setting the correct stop position for sliders with different numbers of slides on a page. When I have the same number of slides in each slider, everything works fine. However, I need to have a different number of slides in each slider ...

Can a create-react-app be created on a virtual private server (VPS)?

I am eager to begin working on a create-react-app project on a VPS so my client can monitor my progress. While I understand you can "Add React to a Website," I am unsure how to incorporate libraries into my site using the tutorial provided on the ReactJS ...