Mobile app version of vmapp.org
Login or Join
Karen161

: And issue I have this meticulous problem, I have a test html page whose body content is a single div tag. I made the width and height of the div tag to 100% and colored the background

@Karen161

Posted in: #Html

I have this meticulous problem,


I have a test html page whose body content is a single div tag.
I made the width and height of the div tag to 100% and colored the background red.


And I get irritated by the white space border around the div tag.
So my questions are:


What is the white space border around that div element?
How do I manipulate it OR get rid of it?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Karen161

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

You can use CSS to remove it.

Before and After.

Just inserted

body, html {
border: 0;
height: 100%;
margin: 0;
padding: 0;
width: 100%;
}


into the CSS. You have to set the height (and occasionally on mobile devices the width too) to 100% in order for the div to follow suit. Then changing the border, margin and padding to 0 (no px, etc) has stood me well for years. Although the floor is open to alternatives.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme