Hello, guys!
I’m currently coding my portfolio, (beginner’s front end project), and I just can’t get rid of this annoying margin on all my divs. I also want a little bit of padding, because I’m not liking my text elements touching the borders of my div. I don’t know if that’s something about bootstrap or about HTML itself. What must I do?
Thanks in advance =)
--------EDIT----------------
It would help to see your code (codepen link?).
If you are using Bootstrap, there should be a sensible balance of margin and padding baked in, but there can be issues that arise from not quite implementing it correctly - either with incorrectly nested divs or misuse (or lack of) .container or .container-fluid classes.
try in CSS
* {
margin: 0;
padding: 0;
}
1 Like
I just put the link to my codepen.io
.container-fluid {
margin: 0;
padding: 0;
}
did the job I think!
1 Like
div {padding-left: 10px; padding-right: 10px;}
this will add 10px distance from left and right border of every div.
Thanks! it worked as I wanted to.
Conners answer is correct. Maybe a css reset.