<p>У цьому прикладі, Ви можете змінювати значення для властивості <strong>grid-row</strong>:</p>

<input type="number" id="start" class="input" min="1" value="1"><span class="slash">/</span><input type="number" class="input" id="end" min="1" value="3">

<div class="box">
  <div class="item">1</div>
  <div class="item">2</div>
  <div class="item">3</div>
  <div class="item" id="block">4</div>
  <div class="item">5</div>
  <div class="item">6</div>
  <div class="item">7</div>
  <div class="item">8</div>
</div>
body {
  font-family: monospace;
  font-size: 16px;
  line-height: 1.45;
}

.input {
  margin-bottom: 36px;
  padding: 4px;
  font-size: 18px;
}

.box {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 5px;
}

.box .item {
  background-color: tomato;
  color: white;
  font-size: 1.4em;
  font-family: monospace;
  padding: 16px;
  text-align: center;
}

#block {
  grid-row: 1 / 3;
  background: gold;
}

.slash {
  font-size: 24px;
  font-weight: 700;
  margin: 0 5px;
}
$('.input').on('change', function() {
  $('#block').css('grid-row', $('#start').val() + '/' + $('#end').val());
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js