-1

Here is the code. I don't know why there is a horizontal scrollbar.

<html>
<head>
</head>
<body style="width: 100vw">
<div style="float: left; width: 220px">a</div>
<div style="float: left; width: calc(100vw - 220px)">b</div>
</body>
</html>
Searene
  • 25,920
  • 39
  • 129
  • 186

1 Answers1

1

This is due to the default margin in the browser stylesheet.

body {
  margin: 0;
}
<html>

<head>
</head>

<body style="width: 100vw">
  <div style="float: left; width: 220px">a</div>
  <div style="float: left; width: calc(100vw - 220px)">b</div>
</body>

</html>
Maharkus
  • 2,841
  • 21
  • 35