<p>現在のブラウザ幅:<span id="size"></span></p>
*{
  text-align:center;
}

p{
  margin-top:20px;
}
const size = document.getElementById('size');
size.textContent = window.innerWidth;

window.onresize = function(){
  size.textContent = window.innerWidth;
};

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.