[Solved] What is the best way to fill the screen without jQuery [duplicate]


float solution

body { margin: 0; }

#a {
  background-color: lime;
  width: 200px;
  float: left;
  height: 100vh
}

#b {
  background-color: blue;
  margin-left: 200px;
  height: 100vh;
}
<div id="a"></div>
<div id="b"></div>

css grid

body {
  margin: 0;
}

.gridcontainer {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 100vh;
}

#a {
  background-color: lime;
  height: 100vh;
}

#b {
  background-color: blue;
  height: 100vh;
}
<div class="gridcontainer">
  <div id="a"></div>
  <div id="b"></div>
</div>

flexbox

body {
  margin: 0;
}

.flexcontainer {
  display: flex;
}

#a {
  background-color: lime;
  width: 200px;
  height: 100vh;
}

#b {
  background-color: blue;
  height: 100vh;
  width: calc(100% - 200px);
}
<div class="flexcontainer">
  <div id="a"></div>
  <div id="b"></div>
</div>

inline-block solution

body {
  margin: 0;
}

.inlineblockcontainer {
  font-size: 0;
}

.inlineblockcontainer>div {
  display: inline-block;
}

#a {
  background-color: lime;
  font-size: 16px;
  width: 200px;
  height: 100vh;
}

#b {
  background-color: blue;
  font-size: 16px;
  height: 100vh;
  width: calc(100% - 200px);
}
<div class="inlineblockcontainer">
  <div id="a"></div>
  <div id="b"></div>
</div>

solved What is the best way to fill the screen without jQuery [duplicate]