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? https://i.sstatic.net/QjNWF.jpg

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

Incorporate a variable into a string

My task here is to prepend a variable before each specific string in the given text. For example: var exampleString = "blabla:test abcde 123test:123"; var formattedString = "el.blabla:test abcde el.123test:123"; In this case, whenever there is a pattern ...

Steps for customizing Material UI select border and label appearance

I've been struggling to change the border of a select component from Material-UI and so far I've attempted: const styles = theme => ({ root: { display: "flex", flexWrap: "wrap", backgroundColor: "lightgrey" }, formControl: { ...

When the mouse leaves, the gauge chart component's size will expand

I have encountered a problem while using the react-gauge-chart library in my react project. Within the project, I have integrated a popover component using material-ui and incorporated the gauge chart component from the library within the popover modal. T ...

three.js canvas, sphere rotates gracefully to the right

Trying to get the sphere to turn right at a very slow pace. Here is my source code: I have created a new container with canvas inside, you can view the code below. How can I make the sphere turn slowly? You can also check out my git repository on github: s ...

When a reaction function is triggered within a context, it will output four logs to the console and

My pokemon API application is encountering some issues. Firstly, when I attempt to fetch a pokemon, it continuously adds an infinite number of the same pokemon with just one request. Secondly, if I try to input something again, the application freezes enti ...

Creating Email Designs with Multiple Layers for Outlook Versions 2007 and 2010

I hope you're all having a fabulous Aloha Friday! I have a question regarding HTML emails, specifically in relation to Outlook 2007 and 2010. Currently, I am working on a project that involves layering a couple of PNG images on top of each other, wel ...

Grunt integration for version control

After sticking to simple Html and Css for the longest time, I'm finally diving into JavaScript for a new project where I want to automate versioning. I've been following the SemVer Guidelines and my projects are currently versioned as "version": ...

How can I locate a single hidden field within a div containing multiple fields?

Within one div, I have three hidden fields. How can I access and retrieve just one of these hidden fields when referencing this specific div? ...

Unable to locate a specific div element using Selenium in Python, encountering a NoSuchElementException

Hello, I'm new to Python and still learning the ropes. Currently, I am attempting to locate something on a particular website. Here is what I'm looking for: <div class="price">$ 1.67<span class="discount">-19.71%&l ...

What causes the sub-menus to move even when they are set to position: absolute?

The sub-menu items under the about link appear to be slightly shifted from the left, despite setting it with position: absolute; left: 0px. I aim to have all menu items (including sub-menus) perfectly overlapped. Below is the code snippet: <html> & ...

Angular facing problems with tracking comment counts in Disqus

After successfully setting up the Disqus comments system on my Angular website following the guide at , everything was working fine. However, when attempting to add the Disqus comment count system to my homepage using the code provided at , I encountered a ...

Exploring Commitments in React

I'm currently navigating the world of promises and finding it challenging to grasp! My main focus right now is setting up an authentication system for my application. RegisterPage The handleSubmit function in my RegisterPage looks like this: handl ...

Using PHP and Ajax to retrieve a distinct string prior to executing a time-consuming script

It's a question that comes up often. In short, I want to display progress to the user while a lengthy script is running. This is my approach: store "progress" in mysql so that Ajax can access it (via PHP). "progress()" is the lengthy script being te ...

The URL is being modified, yet the page remains static in the React application

I've been working on setting up a router with react-router-dom, but I'm facing an issue where my URL gets updated without the page routing to the specified component. Here's a snippet from my App.js: import "./App.css"; import { Br ...

Turn a textfield on and off in real-time

Hey everyone, I've been working on making a textfield dynamic and I wanted to share my code with you: <input type="text" id="test1" value ="dynamic" onfocus="this.disabled=true" onblur="this.disabled=false"> <input type="text" id="test2 ...

What is the best way to create a slideshow that automatically starts upon loading and pauses when hovered over?

I have recently set up a div element for my slideshow. I've included a script to enable navigation using next and previous arrows. However, I am looking to add an automatic slideshow feature that stops on hover. As a beginner, I would appreciate any a ...

Automatically hiding divs when clicked using HTML and CSS

Apologies if this question has been asked before, but I have two onclick divs and I'm trying to achieve a specific behavior. When I open the first one, I want it to automatically close when I open the second one, and vice versa. Below is the HTML cod ...

Make sure to pause and wait for a click before diverting your

Having an issue with a search dropdown that displays suggestions when the search input is focused. The problem arises when the dropdown closes as soon as the input loses focus, which is the desired functionality. However, clicking on any suggestion causes ...

"Utilizing the power of Angular 6's JSON pipe

Looking for a well-structured formatted JSON, but all I get is confusion and this strange image: Does anyone have any insights on what might be causing the issue? HTML <span style="font-weight: 500;">Payload Data: </span> <pre><co ...

Do you have any recommendations for a jQuery plugin that can create a sleek horizontal scrolling image gallery?

Recently, I came across the Smooth div scroll plugin developed by Thomas Kahn, and it fits my requirements perfectly. However, I have encountered a bug that seems to be persisting. The issue arises when both mousewheel scroll and touch scroll are enabled s ...