Is there any way to reference device-height and device-width in your CSS in order to center a div containing dynamic content of varying sizes (images)? Is it possible to use JS to get the effective viewport dimensions and then reference them with SASS/LESS, or am I dreaming?
1 Answer
Here's a simple example of how to get the viewport with JavaScript: http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/
But I would suggest looking into CSS Media Queries: Detect screen width with CSS Media Queries