Neev Jewalkar
Neev Jewalkar

Reputation: 55

Div not being fully sized to 100%

My div is not being fully 100% as there is still a margin to it

output:

enter image description here

at the top there is still some whitespace

CSS code:

.topbar {
    width: 100%;
    height: 10%;
    background-color: black;
}

thanks!

Upvotes: 1

Views: 91

Answers (2)

Nishant Bhosale
Nishant Bhosale

Reputation: 251

html, body{
padding: 0;
margin: 0;
}

This may help you 😊.

Upvotes: 1

Muhammedogz
Muhammedogz

Reputation: 791

You have a margin at your body probably.

Body comes with a default margin. Try this.

body {
  margin: 0;
}

If this not work for you, try to set margin: 0 to your other elements to find which one causing this.

Also you can use developer tools and see where comes from this margin.

Upvotes: 3

Related Questions