Ways to avoid grid items from overlapping with continuous text

import React from 'react';
import './style.css';

import Container from '@mui/material/Container';
//import Grid from '@mui/material/Unstable_Grid2'; // Grid version 2
import Grid from '@mui/material/Grid';

export default function App() {
  return (
    <Container fixed>
      <h1>Hello StackBlitz!</h1>
      <Grid container spacing={2}>
        <Grid item xs={8} md={8}>
          <p>
            !!ldsfjsdlkfjklsdsdjflksdfjldskfjdlskfjdslkfjdslkfjsdlkfdsfjlkdsjfkldsjflksdfjsdlkfjlkjdsflksdjfklsdjflkdsfjlksdfjlsdkfldsjflkdsjlkffjdslkfjsdlkfdsfjlkdsjfkldsjflksdfjsdlkfjlk
          </p>
        </Grid>
        <Grid item xs={4} md={4}>
          <p>
            ldsfjsdlkfjklsdsdjflksdfjldskfjdlskfjdslkfjdslkfjsdlkfdsfjlkdsjfkldsjflksdfjsdlkfjljdsflksdjfklsdjflkdsfjlksdfjlsdkfldsjflkdsjlkffjdslkfjsdlkfdsfjlkdsjfkldsjflksdfjsdlkfjlk
          </p>
        </Grid>
      </Grid>
    </Container>
  );
}


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


I want to not overlap elements in the grid on smaller screens. I believe the text content inside the p tag should be split into new lines.

I also attempted using the new Grid (version 2) component, but it did not solve the issue.

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

Creating a scrollable table body in Bootstrap 4

I am struggling to make a large table mobile-friendly using Bootstrap 4. The table can have up to 10 columns and 100 rows. I need a CSS solution that achieves the following: A fixed header with each column having the same width as its respective row An x/ ...

Kindly advise me on the best method to persist the updated value within the redux store

Whenever I use the useState hook on my page to modify the displayed screen by scrolling through the HTML tag and adding data, it works perfectly. The scroll value and data are saved in the store when leaving the page so that upon returning, the page scroll ...

React display

I've been working on a personal project and wanted to include a lottery wheel. I came across the 'lottery-wheel' package on npm, but unfortunately, my attempts to install and render it were unsuccessful. To install the package, I used the f ...

Understanding fluid design concept

Check out this example. I've noticed that when resizing the viewport, the font size within the .main class increases while there is no change in the .aside class. Can someone help shed light on this for me? Thank you in advance! ...

The animated image gracefully glides down the webpage accompanied by an h3

How can I align an image and h3 tag side by side without the image sliding down? <img src="..." alt="..." /><h3>Shopping Cart</h3> I need them to be next to each other but the image keeps moving down. Any suggestions on how to fix this? ...

Error importing React Icons with the specific icon FiMoreHorizontal

Currently following a guide to create a Twitter-like application and I need to add the following imports: import { FiMoreHorizontal } from 'react-icons/fi' 2.3K (gzipped: 1K) import { VscTwitter } from 'react-icons/vsc' 3.1K (gzipped: ...

The access token provided by Auth0 is invalid

Utilizing the Auth0 service for user authentication has presented challenges with the client id consistently returning an invalid user token. The API successfully accepts access tokens and verifies them on the back-end of a NodeJS application, but encount ...

Hold off on sending POST request until receiving information from external API

Currently, I'm integrating the IBM Watson Tone Analyser API with both Express.js and React in my project. Here's the code snippet that communicates with the Watson API: res.tone to be a string representing the tone received from the analysis ...

Unable to send message to iframe from a different origin

I am encountering an issue with the code below while attempting to post a message and receiving a Blocked autofocusing on a <input> element in a cross-origin subframe. error. import React from 'react' const MyFiles = () => { React.us ...

In the Bootstrap Grid system, all posts are aligned to the left side

I have created a gallery with Bootstrap in React.js. The posts are currently displayed using the bootstrap grid system, however, all posts appear on the left side and I am struggling to center them. Any ideas on how to achieve this? After applying justify ...

Issue with CSS on various mobile devices

Using this CSS to display a fixed part at the bottom of the mobile screen, I noticed that it works well on the Samsung Grand Prime but appears narrower on the Samsung J7 Max. Here is the code snippet and images for reference: .footer { position: fixed ...

The JSColor onChange event is throwing an error indicating that the function is not defined

When attempting to use the onChange event for JSColor to call a function, I consistently encounter an error indicating that the function is not defined. The code snippet below illustrates the issue: export class NavBar extends React.Component { constr ...

Having trouble retrieving the selected values and updating them

I am working on a React project and facing an issue where I am trying to update the values of two selectors and assign them to different states, this.state.sliderMaxSelected and this.state.sliderMinSelected, but they are not being updated. Why is this ha ...

Is there a way to verify the presence of an extra category while mapping through this array in React JS?

When dealing with the SubCategoryDetail, it's important to note that there may or may not be an Additional Category included. To address this, I need a method to determine if an Additional Category exists so that I can either proceed to explore the Ad ...

Is it possible to incorporate async await with SetState in React?

Is there a way to properly setState when needing async/await data inside it? I know it's not recommended, but I'm struggling with getting data before setting the state. Any suggestions? codesanbox: https://codesandbox.io/s/infallible-mendeleev-6 ...

React component created as a constant

I currently have a js file that contains routes for my menu. menuConstant.js import PeopleIcon from '@material-ui/icons/People' export const routers = [ { title: 'Clients', to: '/clients', icon: PeopleIcon, // f ...

I would like a div element to slide up from the bottom of the page

Could someone please assist me in creating a popup div that appears from bottom to top when a specific button is clicked? I would like the div to be fixed without affecting the overall page content. Any help would be greatly appreciated. Thank you! $( ...

Load content in tab by triggering click event

I currently have a set of tabs, and one of those tabs is the "Claims" tab. This particular tab contains some code that will be triggered as soon as the tab is clicked: <Tab eventKey="claims" id="reports-claims-tab" title="Claims ...

I am facing an issue where the state in Next.js React does not get updated when passing a

"use client"; import { EntityType, World } from "@/types/World"; import React, { useState } from "react"; import dynamic from "next/dynamic"; ; let RayTracingPage = dynamic(()=>import("./RayTracingCanvas&qu ...

Nextjs: utilizing static class or employing a use function

Exploring Methods to Create a Tools Class/Function in NextJS I am considering two different approaches for this task. Using Static Class: class Tools { static titleCase(value: string) { return value.charAt(0).toUpperCase() + value.slice(1). ...