<label>
  Задати значення для блоку:
  <input type="checkbox" id="field">
  <span>float: left;</span>
</label>

<div class="wrapper">
  <div id="block">
    <p>Блок</p>
  </div>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
body {
  font-family: monospace;
  font-size: 18px;
  color: #222;
  line-height: 1.45;
}

label {
  padding: 16px 0;
  display: block;
  border-bottom: 2px dashed #666;
}

span {
  padding: 4px 6px;
  background-color: orange;
  border-radius: 4px;
}

.wrapper {
  background-color: #eee;
  padding: 16px;
  margin-top: 16px;
  border-radius: 4px;
}

#block {
  background-color: #666;
  padding: 16px;
  width: 100px;
  text-align: center;
  color: #ddd;
  border-radius: 4px;
}
document.getElementById('field').onchange = function() {
  document.getElementById('block').style.cssFloat = this.checked ? 'left' : 'none';
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.