0

I have a Bootstrap page that looks like this:

<nav> ... </nav> <!-- height not fixed -->
<div class="container-fluid eye-catcher">
  <div class="row">
    <div class="col-sm-8"> ... </div>
    <div class="col-sm-4 image"> ... </div>
  </div>
</div>

In the end, it should look like this: enter image description here

The code for the image I have is this, which works fine...

.image {
  background-image: url("image.png");
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
  height: 100%;
}

...but how can I let the row filling up (only) the remaining space (no scrollbar should be visible then)

krmax44
  • 314
  • 1
  • 2
  • 13

2 Answers2

1

You can add some Flexbox with media queries. Full code HERE

.content {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
nav {
  padding: 10px;
  border: 1px solid black;
}
.image {
  background: lightblue;
}
.left {
  background: lightgreen;
}
@media(min-width: 768px) {
  .eye-catcher {
    flex: 1;
    border: 1px solid black;
    display: flex;
    width: 100%;
  }
  .flex-row {
    display: flex;
    flex: 1;
  }
}
Nenad Vracar
  • 118,580
  • 15
  • 151
  • 176
0

So basically you want to have the two columns the same height? this requires javascript or you can use display: table-cell to manage this, look it up. Via javascript it is by using match-height plugin or by creating a little custom script: http://stack/setting-equal-heights-for-divs-with-jquery

Community
  • 1
  • 1
Luuk Skeur
  • 1,900
  • 1
  • 16
  • 31