1

I try alomst every display:,<span>,white-space,overflow:auto, etc, and search a lot on this site. How to eliminate does damns line breaks on that really specific case. Could you show me, even if its simple ? :)

window.onload = function() {
  document.getElementById("container").style.width = screen.width + "px";
  document.getElementById("container").style.height = screen.height + "px";

}
#container {
  display: block;
  float: left;
  padding: 0px;
  margin: 0px;
  border: 0px;
  background-color: indianred;
  white-space: nowrap;
}
<div id="container">
</div>

LINE BREAK IMAGE

athi
  • 1,683
  • 15
  • 26
  • 1
    That's called "margin" you can get rid of it with `html, body{padding: 0; margin: 0;}` –  May 09 '17 at 03:45

3 Answers3

0

body { margin: 0; }

in your css should do the trick. The browser is adding some default styles to the body by the look of it.

Brett East
  • 4,022
  • 2
  • 20
  • 31
0

This should work.

<body style="margin: 0;">

or

body { margin: 0; }
Hash
  • 7,726
  • 9
  • 34
  • 53
0

You can use normalize.css to cross-browser consistency in the default styling of HTML elements, You can download it from here : https://necolas.github.io/normalize.css/ or you can add via CDN :

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
Nikhil Raj A
  • 175
  • 1
  • 5
  • 16