<div class="container">
  <div class="box">
    <ul class="select">
      <li>
        <label>
          <input type="radio" name="values" value="1" checked />
          <pre class="code-container"><span class="token-property">inset</span>: <span class="token-function">50px 60px 100px 90px</span>;</pre> 
        </label>
      </li>
      <li>
        <label>
          <input type="radio" name="values" value="2" />
          <pre class="code-container"><span class="token-property">inset</span>: <span class="token-function">100px 60px 50px</span>;</pre> 
        </label>    
      </li>
      <li>
        <label>
          <input type="radio" name="values" value="3" />
          <pre class="code-container"><span class="token-property">inset</span>: <span class="token-function">40px 90px</span>;</pre> 
        </label>
      </li>
      <li>
        <label>
          <input type="radio" name="values" value="4" />
          <pre class="code-container"><span class="token-property">inset</span>: <span class="token-function">60px</span>;</pre> 
        </label>    
      </li>
    </ul>                              
    <div class="line top">
      <span class="line-value">50px</span>
    </div>
    <div class="line right">
      <span class="line-value">60px</span>
    </div>
    <div class="line bottom">
      <span class="line-value">100px</span>
    </div>
    <div class="line left">
      <span class="line-value">90px</span>
    </div>
  </div>
</div>
* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #3e464c;
  margin: 0;
  min-height: 100vh;
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

.container {
  --color: #e91e63;
  --border: #fff;
  --top:50px;
  --bottom:100px;
  --right:60px;
  --left:90px;  

  position: relative;
  background-color: #363f45;
  width: 550px;
  max-width: 100%;
  height: 400px;
}

.box {
  padding: 1em;
  line-height: 1.9;
  border-radius: 2px;
  color: #fff;
  position: absolute;
  background-color: var(--color);
  inset: var(--top) var(--right) var(--bottom) var(--left);
}

.line { 
  position: absolute;
  margin: auto;  
}

.line-value {
  position: absolute;
  background-color: #E6DB74;
  color: #1b1b1b;
  padding-inline: .5em;
  border-radius: 3px;
  font-size: .7em;
  font-weight: bold;
}

.top .line-value {
  top: 10px;
  left: 10px;
}

.right .line-value {
  top: 10px;
  right: 10px;
}

.bottom .line-value {
  bottom: 10px;
  left: 10px;
}

.left .line-value {
  top: 10px;
  left: 10px;
}

.top {
  height: var(--top);  
  width: 0;
  border-left: 2px dashed var(--border);  
  top: auto;
  bottom: 100%;
  left: 0;
  right: 0;  
}

.right {
  height: 0;  
  width: var(--right);
  border-top: 2px dashed var(--border);  
  top: 0;
  bottom: 0;
  left: 100%;
  right: auto;  
}

.bottom {
  height: var(--bottom);  
  width: 0;
  border-left: 2px dashed var(--border);  
  top: 100%;
  bottom: auto;
  left: 0;
  right: 0;  
}

.left {
  height: 0;  
  width: var(--left);
  border-top: 2px dashed var(--border);  
  top: 0;
  bottom: 0;
  left: auto;
  right: 100%;  
}

.select {
  display: flex;
  flex-direction: column;
  justify-content: space-between;  
  height: 100%;
  margin: 0;
  padding: 0;
  list-style-type: none;
  color: #fff;
}

.select label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.select input {
  margin-inline-end: 1.4em;
}

.code-container {
  position: relative;
  flex-grow: 1;
  font-size: 16px;
  background-color: #272822;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
  padding: .5em;
  color: #F8F8F2;
  text-align: left;
  line-height: 1.5;
  text-shadow: 0 1px rgba(0, 0, 0, 0.3);  
}

.token-property {
  color: #F92672;
}

.token-function {
  color: #E6DB74;
}

.token-selector {
  color: #a6e22e;
}

.token-comment {
  color: slategray;
}

input[type="text"] {
  border: 0;
  background: none;
  width: 40px;
}

input[type="text"]:focus {
  border: 1px solid currentColor;
}

@supports not (inset: 1px) {
  body::before {    
    content: "Your browser doesn't support inset property";
    display: block;
    color: #e43;
    font-weight: bold;
    background-color: #fff;
    padding: 1em;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    text-align: center;
  }
}
var container = document.querySelector('.container');
var box = document.querySelector('.box');

document.addEventListener('click', function (event) {
  var ele = event.target.closest('input[type="radio"]');
  if (!ele) return;     

  switch (ele.value) {
    case '1':
      container.style.setProperty('--top', '50px');
      container.style.setProperty('--right', '60px');
      container.style.setProperty('--bottom', '100px');
      container.style.setProperty('--left', '90px');
      box.style.inset = "50px 60px 100px 90px";          

      break;

    case '2':
      container.style.setProperty('--top', '100px');
      container.style.setProperty('--right', '60px');
      container.style.setProperty('--bottom', '50px');
      container.style.setProperty('--left', '60px');
      box.style.inset = "100px 60px 50px";                    
      break; 

    case '3':
      container.style.setProperty('--top', '40px');
      container.style.setProperty('--right', '90px');
      container.style.setProperty('--bottom', '40px');
      container.style.setProperty('--left', '90px');
      box.style.inset = "40px 90px";          
      break;

    case '4':
      container.style.setProperty('--top', '60px');
      container.style.setProperty('--right', '60px');
      container.style.setProperty('--bottom', '60px');
      container.style.setProperty('--left', '60px');
      box.style.inset = "60px";          
      break;         

    default:
      break;
  }

  document.querySelector('.top span').textContent = getComputedStyle(container).getPropertyValue('--top');
  document.querySelector('.bottom span').textContent = getComputedStyle(container).getPropertyValue('--bottom');
  document.querySelector('.left span').textContent = getComputedStyle(container).getPropertyValue('--left');
  document.querySelector('.right span').textContent = getComputedStyle(container).getPropertyValue('--right');
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.