Код: Выделить всё
Responsive Text Content
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.content {
text-align: center;
}
Text Content Based on Screen Size
Screen Width:
Screen Height:
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi quae et obcaecati molestias perferendis harum dolorem tenetur, ducimus, modi deleniti earum ipsa molestiae fugit quia maiores delectus provident iure recusandae.
window.addEventListener('DOMContentLoaded', function() {
const screenWidthElement = document.getElementById('screenWidth');
const screenHeightElement = document.getElementById('screenHeight');
screenWidthElement.textContent = screen.view;
screenHeightElement.textContent = screen.height;
});
screen recording
Источник: https://stackoverflow.com/questions/781 ... a-scroll-o