<div class="box">

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

<p>Вона встановлює зміщення позиціонованого елемента щодо нижнього краю.</p>

<strong>bottom: </strong>
<input type="number" class="input" id="num" value="24">px
<strong>;</strong>
  
</div>

<div id="block">24px</div>
* {
  box-sizing: border-box;
}

body {
  font-family: monospace;
  font-size: 16px;
  line-height: 1.45;
  height: 100vh;
  padding: 16px;
}

.box {
  background-color: #f7f7f7;
  padding: 16px;
}

.input {
  margin-bottom: 36px;
  width: 75px;
}

#block {
  background-color: rgba(255, 215, 0, .45);
  padding: 16px;
  position: absolute;
  bottom: 24px;
  left: 16px;
}
$('.input').on('change', function() {
  var num = $('#num').val();
  $('#block').css( 'bottom', num + 'px' );
  $('#block').html( num + 'px' );
});

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