<p>現在のブラウザ幅:<span id="size"></span></p>
*{
text-align:center;
}
p{
margin-top:20px;
}
const size = document.getElementById('size');
size.textContent = window.innerWidth;
window.addEventListener('resize',function(){
size.textContent = window.innerWidth;
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.