0

I've been reading other questions but nothing seems to fix my issue.

I'm trying to create two columns that take up 50% of the screen. I've done this but there's a gap at the top which I can't fix for some reason - what am I doing wrong?

problem

Here's my code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Test column</title>

    <link rel="stylesheet" href="main.css">
  </head>

  <body>
    <div class="container"><div class="col-left">
        hello
      </div><div class="col-right">
        hello
      </div></div>
  </body>
</html>

My CSS:

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


.col-left {
  display: inline-block;
  width: 50%;
  background: #1DA1F2;
  height: 100vh;
}

.col-right {
  display: inline-block;
  width: 50%;
  height: 100vh;
}
Joseph Cho
  • 4,033
  • 4
  • 26
  • 33
apark
  • 3
  • 1
  • 5

1 Answers1

0

That is a margin

html, body {
  padding: 0;
  height: 0;
  margin: 0;
}
Adrian Brand
  • 20,384
  • 4
  • 39
  • 60