What steps can I take to decrease the padding of this footer?

Is there a way to reduce the height of the footer so it doesn't dominate the screen on both large and small devices?

import { Container, Box, Grid } from "@material-ui/core";

const Footer = (props) => {
  return (
    <footer>
      <Box
        px={{ xs: 3, sm: 10 }}
        py={{ xs: 5, sm: 10 }}
        // bgcolor="text.secondary"
        // color="white"
        color="text.secondary"
        bgcolor="#E3F2FD"
      >
        <Container maxWidth="lg">
          <Grid container spacing={5}>
            <Grid item xs={12} sm={4}>
              <Box borderBottom={1}>Help</Box>
              <Box>Contactt</Box>
              <Box>Support</Box>
              <Box>Privacy</Box>
            </Grid>
            <Grid item xs={12} sm=4>
              <Box borderBottom={1}>Help</Box>
              <Box>Contactt</Box>
              <Box>Support</Box>
              <Box>Privacy</Box>
            </Grid>
            <Grid item xs={12} sm=4>
              <Box borderBottom={1}>Help</Box>
              <Box>Contactt</Box>
              <Box>Support</Box>
              <Box>Privacy</Box>
            </Grid>
          </Grid>
          {/* change name of the website here */}
          <Box textAlign="center" pt={{ xs: 5, sm: 10 }} pb={{ xs: 5, sm: 0 }}>
            Website &reg; {new Date().getFullYear()}
          </Box>
        </Container>
      </Box>
    </footer>
  );
};

export default Footer;

Check out the codesandbox for this footer - https://codesandbox.io/s/nameless-frog-ros09?file=/src/App.js

Answer №1

It appears that the significant padding is determined by the utilization of the px and py properties within the Box component.

Upon visiting https://material-ui.com/system/spacing/, we can ascertain that px denotes horizontal padding (padding-left and padding-right), while py signifies vertical padding (padding-top and padding-bottom).

Exploring https://material-ui.com/customization/spacing/, it becomes apparent that Material UI defaults to a padding value of 8 px for spacing = 1.

Furthermore, referencing https://material-ui.com/customization/breakpoints/, it is evident that xs pertains to extra small screens and sm relates to small screens.

Hence, the declaration of px={{ xs: 3, sm: 10 }} implies that both left and right padding equate to 3 * 8 px = 24 px for extra small screens, and 10 * 8 px = 80 px for small screens or larger (due to the absence of definitions for md, lg, and xl in the code).

An illustration denoting the impact of commenting out the px and py properties in the Box component is presented below.

 // Code snippet omitted for brevity 

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

Expanding the input range slider to fill the entire available space

https://jsfiddle.net/a5gdhmfn/1/ <div> <i>O</i> <input type="range" /> <button/> <div>...</div> </div> Inside a div, there is a range slider along with other fixed-width elements. The issue ...

live PHP recording of data moving between tables

As a beginner, I am working on a project to organize groups of people on the screen using PHP code. I have managed to list Distribution Lists, Member Lists, and People, but I lack experience in this area. Can anyone provide some guidance on how to proceed? ...

What is the best approach for retrieving values from dynamically repeated forms within a FormGroup using Typescript?

Hello and thank you for taking the time to read my question! I am currently working on an Ionic 3 app project. One of the features in this app involves a page that can have up to 200 identical forms, each containing an input field. You can see an example ...

Rendering form buttons conditionally can be done using an Mui Button with the type 'submit', which will automatically submit the form when it is rendered

I am working on a multi-step form that utilizes the Stepper component. The continue button transitions into a 'Submit Form' button when the user reaches the final step. However, I encountered an issue where the submit button with type='subm ...

What could be the reason for receiving an undefined user ID when trying to pass it through my URL?

Currently, I am in the process of constructing a profile page and aiming to display authenticated user data on it. The API call functions correctly with the user's ID, and manually entering the ID into the URL on the front end also works. However, wh ...

Reloading the table columns in a JSP page with a click of the refresh button on every row using AJAX and JavaScript

Hey there! I have a JSP page with a table where data is displayed by iterating through a list from the action class. Each row in the table has a refresh button at row level. Here is a snippet of the JSP: <script type="text/javascript"> functi ...

What is the importance of having Express in the frontend?

As someone who is relatively new to the world of JavaScript and web applications, I recently came across an Express web application project that contained a public directory, client directory, and server directory. This has raised some questions for me. I ...

What is the best way to vertically center all content, including borders, within the columns?

To view the codepen for reference, please click on the following link: http://codepen.io/rezasan/pen/apvMOR I am attempting to align all the content within the columns (Date, Title, and Button, including the separator) vertically. I have tried using displ ...

Using localStorage item as query value in socket.io: A step-by-step guide

Goal To authenticate users through a socket.io connection by passing a token from localStorage. Following the instructions in the documentation, I have initialized io() outside of MyComponent and added the token as a query: const token = localStorage.getI ...

"Exploring the process of retrieving data from a request in Node.js with the help of the Express

I'm encountering some issues with integrating a "login" form into my Node.js script. While I can get it to work using a static HTML page, utilizing a dynamic ".ejs" page is causing trouble as my form fields are showing up as "undefined". var helmet = ...

The nonexistence of the ID is paradoxical, even though it is present

I've been working on a school project that involves a dropdown box with the id "idSelect." However, I'm encountering an issue where it says that idSelect is not defined when I try to assign the value of the dropdown box to a variable. Even after ...

Utilizing jQuery to Execute a Function Upon Addition or Removal of Class Names

Currently, I am working on a function that includes a conditional statement to display an alert when a specific class name is removed from a div layer. Below is the code snippet: <div class="ui-tabs-panel ui-tabs-hide">panel</div> <div>& ...

Ways to transmit information from a React application to a Node server

As a Nodejs beginner, I am using the rtsp-relay library for live streaming. Currently, it is working in the frontend when the URL is included in the server proxy object like this: rtsp://.....@..../Stream/Channel/10. However, I want users to be able to inp ...

Encountering a NextJS Error while trying to render a page, following a recent post

Recently, I encountered an issue with my Next.js application that is connected to my NodeJS API. I have a form on one of the pages that sends POST requests to the backend API. However, upon submitting the form and being redirected to another page, pressin ...

A guide to displaying the date retrieved from a JSON data file API request using JavaScript

How can I display the date from a JSON data file API call using JavaScript? I am facing difficulty in showing the date on the dashboard display page. I am utilizing JavaScript with async-await for calling the API, and Bootstrap 4 for design. The function ...

Change the term to its corresponding translation

I have developed an Ionic Multilingual App that includes a select feature. Within this select, choosing a specific option disables certain page elements. However, I am facing an issue where one of the elements needs to change its text based on the selected ...

"Exploring the Power of ZF2 with Restful APIs and Image

I am currently in the process of developing a website utilizing Zend Framework 2 in combination with AngularJS. The backend consists of a restful webservice running on ZF2, while AngularJS is used on the client side to interact with this webservice. My ne ...

JavaScript Mouseover Custom Trigger with d3.js Library

Currently, I am experimenting with d3.js and am interested in creating a custom event with a unique trigger. From my understanding, the 'mouseover' event occurs when the mouse pointer hovers over a specific element both horizontally and vertical ...

The Oscillator node in the Web Audio API is unable to be started more than once due to an error

Every time I attempt to start, stop, and then start my oscillator again, I encounter the following error message: Uncaught InvalidStateError: Failed to execute 'start' on 'OscillatorNode': cannot call start more than once. Although usi ...

The jQuery autocomplete feature with typeahead suggestions fails to appear following a successful AJAX request

I am currently using typeahead.js to incorporate tags into my multiple input setup. The tagging function works as expected, however, I am facing an issue where the autocomplete suggestions are not appearing. Is there a solution to fix this problem? Despit ...