Try adding a margin: 0
to that div
, and a margin: 0; padding: 0;
at the body
. Would look like this:
body{
margin: 0;
padding: 0;
}
.top-bar {
position: relative;
width: 100%;
height: 60px;
background: #313D4C;
margin: 0;
}
However, the ideal would be an application of these styles to all elements, you would achieve this through the selector *
css, it goes like this:
*{
margin: 0;
padding: 0;
}
Besides you could put one border-box: box-sizing
, very well explained in that article. It would make the determinations of the elements' sizes, already take into account by themselves margins, spacings, edges, among other things.
Thanks man, solved here. But if I use * will not end up bugging other elements ?
– user37798
This will depend on your code, test and see. Usually not, as it will take into account the paticular Styles to each element. So if you determined margins, these remained there.
– Samir Braga