Applying FAB (Material UI) to span across 2 columns in a CSS Grid: A step-by-step guide

Is there a way to make the zero button larger than the other buttons in its row by spanning 2 columns? I would like it to be an oversized oval shape. Appreciate any assistance you can provide.

import "./styles.css";
import Button from '@mui/material/Button';
import Fab from '@mui/material/Fab';

export default function App() {
  
  return (
    <div className="App">
      <div className = "blank"> </div>
      <div className = "btn-container-div"> 
      <div className = "screen-div"> </div>
      
      <div className = "row"> 
      <Fab> AC </Fab>
      <Fab> +/- </Fab>
      <Fab> &#37; </Fab>
      <Fab> &#247; </Fab>
      </div>
      <div className = "row"> 
      <Fab> 7 </Fab>
      <Fab> 8 </Fab>
      <Fab> 9 </Fab>
      <Fab> &#215; </Fab>
      </div>
      <div className = "row"> 
      <Fab> 4 </Fab>
      <Fab> 5 </Fab>
      <Fab> 6 </Fab>
      <Fab> &#247; </Fab>
      </div>
      <div className = "row"> 
      <Fab> AC </Fab>
      <Fab> +/- </Fab>
      <Fab> % </Fab>
      <Fab> &#8722; </Fab>
      </div>
      <div className = "row"> 
      <Fab> 0 </Fab>
      <Fab> . </Fab>
      <Fab> &#61; </Fab>
      </div>

      </div>
      
    </div>
  );
}
.App {
  display: grid;
  background:black;
  height: 150vh;
  width: 100vh;
  margin: auto;
  grid-template-rows: 2fr 10fr;
}

.blank {
  background: red;
}

.btn-container-div {
  background: blue;
  display: grid;
  grid-template-rows: repeat(6,1fr);
  
}

.screen-div {
  background: white;
}

.row{
  background: black;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  justify-items: center;
}

Is there a way to make the zero button larger than the other buttons in its row by spanning 2 columns? I would like it to be an oversized oval shape. Appreciate any assistance you can provide.

Answer №1

The issue has been resolved. I included a new className for the fab element and applied grid-column: span 2 in the CSS.

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

Using @media queries for mobile and desktop: preventing desktop from displaying mobile styles

I have been working on redesigning a website for mobile using only CSS. I set up media queries to deliver the appropriate CSS for desktop and mobile devices. However, I noticed that when resizing the browser to under 855 pixels, some of the mobile CSS is ...

Step-by-step guide on incorporating a new JSON object into an array to display its elements as components on a webpage

Could I adjust the state of an array by incorporating values from a data.js file as a starting point? The process involves executing the setAllThingsArray function to add a new element, determined by the setThingsArray function based on the previous state ...

React video recording not displaying in the video element

I'm currently developing a React application that facilitates webcam interviews with candidates. As part of this process, candidates have the option to "Start Again" or "Complete" their interviews. One challenge I am facing is displaying the recorded ...

Can Material-UI CardText be customized for editing?

I've created a Material-UI card based on the example from the Material-UI documentation. What is the most effective way to incorporate editable CardText within it? ...

Function that wraps JSX elements with the ability to infer types through generics

At the moment, this function is functioning properly function wrapElement(elem: JSX.Element) { return ({ ...props }) => React.cloneElement(elem, { ...props }) } I've been using it in this way to benefit from intelliSense for tailwind classes con ...

It is essential for npm to automatically install peer dependencies in the parent project without overlooking them

I am currently facing an issue with publishing a react application, let's call it project-A, as an npm package. This project has several dependencies like material-ui, dompurify, recharts, and more. In another application, project-B ...

Display a horizontal progression indicator during the page download process

Occasionally, website pages may take a while to download without the user even realizing it. This can be problematic if the user clicks on an image or button with an event handler attached, as it may break the page functionality. To address this issue, I ...

React flux mouse position resetting upon store emitting a change event

I'm currently working on a page that showcases a collection of articles. When users reach the bottom of the page, they have the option to click on "load more" to fetch additional articles and update the list within the Store. However, I've notice ...

Using react hooks, I am refreshing the product image by replacing it with the thumbnail image

I'm currently working on an e-commerce platform that resembles Amazon. In the product detail page, I want the right side image to update when I click on a thumbnail image on the left side. The issue I'm facing is that upon first loading, the def ...

Tips for employing CSS hover within HTML elements?

Is there a way to achieve the following: <li style="hover:background-color:#006db9;"> I have tried this approach but it doesn't seem to work. Is there an alternative method, or do I need to include the CSS in the head section or an external CS ...

Fixing Bugs in Checkbox Functionality using useState in Reactjs when implementing Material UI

I am working on a numeric select functionality where selecting a number renders the component multiple times. Inside the component, there are checkboxes that should not all activate at once when one is selected. You can view the code in the sandbox: http ...

What is the best way to combine height and min-height in order to ensure that a div always extends to the bottom and keeps

I've tried multiple suggestions without success so far. In my website, I have a main section with white background centered on the page. It stretches nicely to the bottom using flex. See image: However, there's a specific section with lots of co ...

The evolving impact of the HTML5 <video> element

I've been attempting to find information on this topic, but unfortunately my search has not been very successful. I vaguely recall coming across a tutorial that covered something like this. Does anyone happen to know how to alter the perspective of a ...

Is there a way to retrieve the immediate children of all elements using CSS selectors in Selenium?

Although I attempted to utilize the ">" syntax, selenium does not seem to accept it. I am aware that Xpath can be used to obtain what I need, however our project exclusively utilizes CSS selectors. My goal is to create a list containing only the immedi ...

You can't observe the behavior of simulated functions in a class with a manually created mock

Kindly note that I have set up a comprehensive Github repository where you can download and explore the content yourself here I am currently working on mocking a non-default exported class within a module using a manual mock placed in the folder __mocks__ ...

I am integrating Material-UI's flat pagination feature into my React project

Looking for advice on implementing pagination logic in my application. I am fetching a list of jobs from the freelancer api and using https://www.npmjs.com/package/material-ui-flat-pagination to handle pagination. The page numbers are displaying correctly ...

What is the best way to eliminate the scroll buttons from a scroll bar within a scrollPane in JavaFX?

Here's a snippet of code from the CSS file: .scroll-bar .button { visibility: hidden; -fx-background-color: black; } Despite this code, the scroll bar buttons are unaffected. You can see an image of the issue here. I would greatly appreciate any hin ...

What symbol represents the share function in Unicode?

I've combed through Google, Stack Overflow, and various HTML character sites multiple times but have been unable to find the specific icon I'm looking for. Can someone please assist me with obtaining the HTML Unicode sequence for an icon that rep ...

The function window.scrollBy seems to be causing a conflict with jjmslideshow, resulting in the page being unable to

I wrote a simple script to create a "smooth scroll" effect when a specific link is clicked: (function() { 'use strict'; // Checking for compatibility if ( 'querySelector' in document && 'addEventListener' in window ...

Creating a gradient background with the makeStyles function

Why is it that the background: 'linear-gradient(to right, blue.200, blue.700)' doesn't work within makeStyles? I just want to add a gradient background to the entire area. Do you think <Container className={classes.root}> should be rep ...