The material UI Paper component appears to be extending beyond the boundaries of the background image

I have configured the Grid component to occupy 6 on small/medium screens for a side-by-side layout and 12 on xs screens for each item. While everything looks fine in the computer view, I am facing an issue with the mobile view where the paper component is overflowing outside of the background image at the bottom. *UPDATE It appears that the problem stems from giving the paper component a padding of 5. Is there a more effective way to create space around my text? Does anyone have a solution for this?

import Grid from '@mui/material/Grid';
import React from 'react'
import bitMoji from "../images/bitMoji.png"
import Container from '@mui/material/Container'
import Box from '@mui/material/Box'
import { Typography } from '@mui/material';
import Paper from '@mui/material/Paper';

function About() {
    return (
        <Container maxWidth="md">

            <Grid marginTop={10} container space={2}>
                <Grid item xs={12} sm={6} md={6}>
                    <img style={{
                        maxWidth: '100%',
                        height: 'auto'
                    }} src={bitMoji} alt="" />
                </Grid>

                <Grid xs={12} sm={6} md={6}>
                    <Paper sx={{
                        padding: 5
                    }} elevation={10}>
                        <Typography variant="p" component="p">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi, sed beatae. Laboriosam perspiciatis molestiae delectus deleniti! Explicabo inventore eius ad veniam rem illo architecto ut, numquam atque officia et quae?
                        </Typography> 
                    </Paper>
                </Grid>
            </Grid>
        </Container>
     )
}

export default About

App.css


  height: 100vh;
  overscroll-behavior: none;
  scroll-behavior: smooth;
  
  background-repeat: no-repeat;
  background-image: url('https://images.unsplash.com/photo-1557128928-66e3009291b5?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80');

Answer №1

Although it may seem like a simple solution, I encountered an issue with the background image I initially chose as its resolution was too small to properly fit 100vh.

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

Retrieving pals from the API and showcasing them on the user interface

Currently, I am working on a project involving a unique Chat Application. While progressing with the development, I encountered an issue related to fetching friends data from the backend (node). Even though I can successfully retrieve the friends data in ...

Issue: Unable to assign type 'FormDataEntryValue' to type 'string'. Type 'File' cannot be assigned to type 'string'

After retrieving data from the formData, I need to pass it to a function for sending an email. Error: The error message states that 'FormDataEntryValue' is not compatible with type 'string | null'.ts(2322) definitions.ts(119, 3): The e ...

Clicking does not trigger scrollIntoView to work properly

I'm facing an issue with a button that is supposed to scroll the page down to a specific div when clicked. I implemented a scrollIntoView function in JavaScript and attached it to the button using onClick. Although the onClick event is functioning as ...

Does the CSS overflow property affect the borders of an element?

Consider a situation where a "div" element has a border applied to it. When the overflow rule is set to 'hidden', any content that falls directly on the border will vanish. Is there a solution for this issue? It is crucial in my case to ensure t ...

Using an if statement to run a script in Npm

Is there a way to configure an npm run script to use different AWS accounts based on the environment? { "config": { "acc": if ({npm_config_env} == "dev") "account1" else "account_2" }, "scr ...

Can we establish communication between the backend and frontend in React JS by utilizing localstorage?

Trying to implement affiliate functionality on my eCommerce platform. The idea is that users who generate links will receive a commission if someone makes a purchase through those links. However, the challenge I'm facing is that I can't store the ...

Implementing JWT Authentication in Next.js

I have made the decision to transition a project from React to Next.js and have some doubts regarding whether the authentication process remains appropriate. Essentially, the user inputs their username and password which is then verified against database c ...

Invoke a PHP function within a Bootstrap Modal using AJAX technology

My webpage features a list of users generated through a PHP loop. By clicking on each user's name, a Bootstrap Modal appears showcasing more information about the user. The hyperlink for each user looks like this: <a href="#user" data-toggle="mod ...

Include token in src tag requests Angular version 8

In the process of developing a website, I have encountered a challenge. I am creating a platform where users can access another website I am currently working on after they log in. Once authorized, users receive a JWT token which is sent in the header with ...

Child component fails to reflect updated parent state in React

Currently, I am facing an issue with updating the posts display based on the author's ID on this particular page. I am utilizing React Redux and using useCallBack in other components to update the count and authorID. However, the child component below ...

Having trouble resolving the 'crypto' module error after using xlsx-populate in React JS? Here's how to fix it!

Recently, I encountered an issue when using the xlsx-populate package in my React JS application. Compiled with problems: ERROR in ./node_modules/xlsx-populate/lib/Encryptor.js 14:15-32 Module not found: Error: Can't resolve 'crypto' in &a ...

Dynamic autocomplete feature with AJAX integration for filtering in Flask

Looking for some guidance on creating an HTML form with two input fields. Check out the HTML template code below: <form role="form" action="/cities/" method="get" autocomplete="on"> <label for="#input1"><strong>Country:</strong&g ...

Adding the type 'dark' to a MUI palette causes my website to malfunction, unless it is explicitly specified in the createMuiTheme() function

I am having trouble setting a 'dark' theme with MUI on my website when specifying type: 'dark' outside of the immediate createMuiTheme() function. Here is an example that works: const siteTheme = createMuiTheme({ palette: { prim ...

"Utilize Vue i18n to properly display currency amounts in USD

Whenever I present my currency as USD, it always shows up like this: USD$500.00. I am attempting to eliminate the USD prefix from the beginning. Below is my numberFormats configuration: numberFormats: { 'en': { currency: { ...

Generating prime numbers in Javascript

My attempt at generating the prime numbers less than 20 using my current knowledge is as follows: let arr = []; for (let x = 3; x <= 20; x++) { for (let i = 20; i > 0; i--) { if (x % i !== i) { arr.push(x) } } console.log(arr) ...

The 'Required' attribute in HTML is malfunctioning

The 'required' attribute is not functioning properly when I try to submit the form. I've searched online for a solution, but none of them have resolved my problem. Take a look at the code snippet below - I've used the required attribute ...

Load a form using ajax and submit it using jQuery

For a while now, I have been facing challenges in figuring out what's going wrong with my code. The issue arises when I try to submit a form using jQuery that was loaded through ajax. The form loads perfectly fine within a div after invoking the ajax ...

When working on a MEAN web application, encountering HTTP responses like 403 or 500 from the Express server can sometimes go unnoticed and not be properly handled in the errorCallback function within

Within my Node web app, there is a situation where an HTTP GET request is sent in one of the Angular controllers. At the same route defined in Express, somewhere in the route logic, an HTTP 500 response (also tried 403 Error) is also being sent. However, i ...

Utilizing props within the makeStyles keyframe animations

How can I successfully pass props to the keyframes in makeStyles when using fill value? Do I need to define initial states for the prop to be passed? The color passes correctly, but the fill value does not. ---Child component const useStyles = makeStyles ...

Creating a sleek animation with JQuery for a dynamic-width div

Here is a snippet from my latest project. Take a look at the demonstrationFIDDLE. In this project, I have created a list with buttons: <a href="#f1" class="bt">1 <div class="show">Computers Networking</div> </a> When you ...