<section id="welcome-section" class="welcome-section">
<h1>Hello My name is Ben</h1>
<p>A Web Developer </p>
</section>
add in your css :-
body {
margin: 0;
padding: 0;
}
Solution 2 :
You could try adding border: 0 to your style rules. It sounds like by ‘margin’ you mean border
It’s likely something else on the page is setting a border. You really should share a full example though.
Solution 3 :
Try this,
Add this to your css
body{
margin: 0%;
}
It will fit background color to the border.
Problem :
For some reason the code below will output a black background that has white margins around it. I even have margin: 0px but for some reason the margins are still there. I have tried to set all the other elements to 0 margin but that didn’t work either.
There is nothing in the code you’ve posted that would cause white margins to appear. You probably have other style-rules elsewhere that are affecting your page’s appearance.
Comment posted by Abhishek Pakhare
If you see the code in chrome devtools you will find that there is
Comment posted by necolas.github.io/normalize.css
To add to what others have already said – many browser render the “default” values of certain things slightly different from one another. In this case, the