everything seem to be working fine in the website’s home page , but all my div elements get this unwanted margin on the right.
I tried using the "width:100%" I used the max and min-width properties also, but nothing seems to be working.and its beginning to make me feel overwhelmed . I need all the help this poor beginner can get please .
2
Answers
You might want to reset CSS as follows. I will show you my way that I love to use before setting up the project.
This might remove all unwanted and unexpected redundant margin and paddings in your website.
Also, check out by yourself with opening developer tool and mouse hover on the part where you think it looks awkward. Some html tags such as
<h1>
might have default margin/padding.fit-content
CSS property for this. This allows you to tell element to consumes as fit as possible along with the content in itself. This might also help to delete unwanted margin/padding.Maybe there is a parent container that has a fixed width or padding.
Or maybe it is overflowing horizontally and causing a scrollbar to appear.
In that case, add this to your divs: