December 4, 201213 yr Hi, I set width of body to 100% but I've got some problems with % and that is why I want to change it to pixels. how many pixels equal to 100% ? is it possible to find out pixels of screen or browser by javascript then dynamically set the width and height ? tnx a lot.
December 4, 201213 yr javascript has window.innerWidth if that's what you want. What's the problem you're encountering using %. Perhaps we can solve that instead of relying on JS.
December 4, 201213 yr how many pixels equal to 100% ? By definition the amount of pixels is the full width of the browser. If you resize the browser, the pixels with be 100% of the available screen size at that moment. Have a look at this: http://www.w3schools.com/js/js_window.asp or fiddle around with this: var w=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var h=window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; document.write('The width of the browser is ' + w + 'px <br>'); document.write('The height of the browser is ' + h + 'px');
December 4, 201213 yr Author javascript has window.innerWidth if that's what you want. What's the problem you're encountering using %. Perhaps we can solve that instead of relying on JS. Hello, visit http://www.webdesignerforum.co.uk/topic/66207-css-problem-with-zooming-inout-the-browser/ in this topic I have explained the problem, my problem is in zooming in/out the browser
Create an account or sign in to comment