What the device-width CSS3 property refers to? Is it screen.width or rather window.innerWidth?
            Asked
            
        
        
            Active
            
        
            Viewed 815 times
        
    1
            
            
         
    
    
        Mulligun81
        
- 119
- 1
- 13
- 
                    http://www.quirksmode.org/mobile/viewports.html – Lalji Tadhani Aug 30 '16 at 13:15
2 Answers
0
            
            
        According to MDN
Describes the width of the output device (meaning the entire screen or page, rather than just the rendering area, such as the document window).
And this question:
max-device-width is the width of the device's entire rendering area, i.e. the actual device screen
Therefore it's screen.width.
- 
                    So `screen.width` is always the same (constant) for concrete mobile device? – Mulligun81 Aug 30 '16 at 13:36
- 
                    @Mulligun81 No! The user can rotate the device so that the width becomes the height. – Mr Lister Aug 30 '16 at 13:46
- 
                    Ok i understand. Can You explain me then why does setting `height=device-height` viewport property doesn't work - `window.innerHeight` always reports the same vale while setting `width=device-width` is reflected by `window.innerWidth`? – Mulligun81 Aug 30 '16 at 14:01
- 
                    
- 
                    
 
     
    