I am just starting out as a beginner in web development. I decided to create a webpage to practice my HTML and CSS skills. However, when I set the width of all elements to 100%, I noticed that I am getting a horizontal scroll bar. I have tried troubleshooting the issue extensively but unfortunately, I haven't been successful.
Here is a snippet of my code:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
header {
width: 100%;
height: 89vh;
display: grid;
grid-template-columns: 53.7% auto;
// More CSS code here...
I am facing an issue with a persistent scrollbar despite setting the elements to 100%. When inspecting the page, the scrollbar appears, but in the normal window view, everything looks fine.
Can anyone help me identify the problem within my code and provide suggestions on how to resolve this scrolling issue?