I am noticing that my react application has an unwanted horizontal scroll. I see that if I comment out the <About/> component then the scroll disappears. Not sure as to why it is getting added. It goes away if I add overflow-x: hidden to App.css but it doesnt seem like the right solution.
Also, I se that <About/>= BLUE component is coming on the RED part. I am not able to understand why it is happening.
Appreciate any help.
These are the files and theScreenshot:
App.js
import React from "react";
import "./App.css";
import "bootstrap/dist/css/bootstrap.min.css";
import Landing from "./Components/Landing";
import About from "./Components/About";
function App() {
return (
<div className="App">
<Landing />
<About />
</div>
);
}
export default App;
App.css
.App {
height: 100vh;
width: 100vw;
max-width: 900px;
padding: 1rem;
background-color: lightpink;
}
Landing.js
import React from "react";
import "./Landing.css";
function Landing() {
return (
<div className="LandingContainer"></div>
}
export default Landing;
Landing.css
.LandingContainer {
height: 100%;
width: 100%;
background-color: lightgreen;
}
About.js
import React from "react";
import "./About.css";
function About() {
return (
<div className="MainAboutContainer"></div>
}
export default About;
About.css
.MainAboutContainer {
background-color: lightblue;
width: 100%;
height: 100%;
text-align: center;
}