Chrome does not showing width of screen as screen resize? - html

This question may be very simple. Usually as we inspect an element and we re-size browser ,browser automatically shows the width of screen.Currently i am using chrome but as i inspect any element it does not show width height of screen.I am making a site responsive but my browser not showing any screen size so i am in trouble .I seach for it but i have not found any result .I also did restores default and reload from setting but it has no effect.Any help would be highly appreciated

Just updated to Chrome 49 and learned that there is indeed a bug causing this issue.

Chrome show the resolution in the upper right corner, but you need to have opened web developer tools(right mouse button -> Inspect element).
You can also use chrome Toggle device mode.

You can use this example based on javascript that will tell you the current width of the window:
var onresize = function()
{
var width = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
console.log(width);
}
Press f12 and then press Esc to see console.

That’s very odd. I would make sure you’re on the latest version first. If that doesn’t fix it, you could try using Device Mode for responsive testing https://developers.google.com/web/tools/chrome-devtools/iterate/device-mode/

Related

How do I prevent Google Chrome Developer Tools from resizing the browser viewport?

Basically, I want Chrome Webtools to overlap my browser viewport instead of resizing it.
I tried undocking the tools window, however this splits it into another window which is undesirable. I want both the console and the viewport in the same window, just overlapping.
Current behavior:
Desired behavior:
Thanks!
You can click here and select Undock to seperate windows.
I think you have to Dock Side from the three Dots at the side of console and ... have to manually frame it to the location you want

Browser doesn't scale below 400px?

I'm working on putting together a liquid style-sheet and it works wonderful. One thing that I've noticed is that my browser window in Chrome won't resize below 400px it just gets stuck there and in FF as I scale down it it just stops at around 400px and then pops a horizontal scroll bar.
When I open the site on my phone it looks perfect at around 320px, so I know it does scale lower than 400px.
I was curious if anyone knew if this was a browser/desktop thing or if I should be looking at something other than my CSS. I don't have any min-width declarations so i'm not sure what could be causing this.
Again on desktop it scales down to a min-width of about 400px and stops, but when I open it up on my phone it scales to the size of the phone screen which is roughly 320px... curious why at the very least it won't scale down to the 320px on desktop.
-edit-
Also I'm not sure if this matters but Opera allows it to scale down to pretty much nothing... So it works with Opera and not in Chrome or FF... any ideas?
Chrome cannot resize horizontally below 400px (OS X) or 218px (Windows) but I have a really simple solution to the problem:
Dock the web inspector to the right instead of to the bottom
Resize the inspector panel - you can now make the browser area really small (down to 0px)
Update: Chrome now allows you to arrange the inspector windows vertically when docked to the right! This really improves the layout.
The HTML and CSS panels fit really well and you even open a small console panel too.
This has allowed me to completely move from Firefox/Firebug to Chrome.
If you want to go a step further look at the web inspector settings (cog icon, bottom-right), and goto the user agent tab. You can set the screen resolution to whatever you like here and even quickly toggle between portrait and landscape.
UPDATE: Here is another really cool tool I've come across. http://lab.maltewassermann.com/viewport-resizer/
this may be because of the addons you installed on your browser. remove or hide all addon icons from the tool bar and try re size. when there are addons browser only resize the address bar and keeps the addons visible.
Update: 7/14/2013
With the latest chrome version, now you can re-size the address bar and it will hide the addons automatically.
I was stumped as well but ended up with a simple solution. I just created a HTML file with a link to open a new window:
Open!
This new window has nothing but the address bar and Chrome lets me freely resize this down to 111x80.
nayan9's solution works great, and can be put into a bookmark without having to create a html file. In Chrome, create a new bookmark with URL:
javascript:(function(){window.open('ANY_URL', '','width=320,height=480');})();
And give it a name of "Open Small Window" or something similar. This will allow you to easily open windows without size restrictions within chrome. Note that just copying this into your address bar won't work - chrome strips the "javascript:" out.
In case you want to reduce your screen width to emulate different devices (and why else would you want to do this?):
Chrome now has an Emulation section in its inspector, activated by clicking the little phone icon in the top menubar (between the magnifying glass and Elements):
Emulation mode allows you to set the viewport size to all common mobile screen sizes, among other nice features, like emulating touch, geolocation and even accelerometer input:
Adding to what nayan9 and drinkdecaf said, you can just throw document.URL into the call to window.open to see the page you're currently viewing in the 320 window. You might want to add some more to the width if you're expecting a scrollbar.
javascript:(function(){window.open(document.URL, '','width=320,height=480');})();
I am lazy, to make it even easier, let the bookmarklet ask the user for sizes :-D
javascript: (function() {var width = prompt('Enter window width:', '320');var height = prompt('Enter window height:','480');var url = prompt('Enter window URL');if (url.indexOf(':') < 0) {url = 'http://'+url;} window.open(url, '','width='+width+',height='+height);})()
in chrome the icons of your addons in the top right corner cause the problem
-> resize the adress-bar (where you type the urls) to maximum width (drag the bar at the right edge to the right)
or disable the icons
The DevTools in Chrome have moved on substantially from when most of these answers were posted. The best way to address this issue now is to use the emulators that are built into Chrome.
To use the emulators open DevTools (press F12) and then click on the following icon to toggle the Device Toolbar:
This will then allow you to emulate whichever mobile device or viewport size you want to.
I found a quick workaround for this.
Just install the Responsive Web Design Add-on to Chrome, and it will open a separate window without the address bar and tabs, which can be scaled down to 10 px or less.
Link here: https://chrome.google.com/webstore/detail/responsive-web-design-tes/bdpelkpfhjfiacjeobkhlkkgaphbobea/related
I've been experiencing similar issues and just found a good work around. Open up your chrome devtools and in the top left, there's a little screen and ipad icon. Click that and it opens a mobile view of your page. You can set it to predefined devices or a custom resolution. Pretty nifty actually.
Another easy solution is to click Strg+Shift+N to enter Incognito Mode. There you can resize your Browser window as you like.
I like this tool because it lets you switch quickly and also switches between portrait/horizontal easily for mobile sizes. It also allows you to make a personalized bookmark let, so if you design for obscure resolutions frequently, you can save them and use them.
I had to use one of these tools because even with the above answer I couldn't get my window to scale to 320 properly, this tool seems to be a faster solution overall.
http://lab.maltewassermann.com/viewport-resizer/
I'm always running into this issue with pinned tabs. Chrome will not resize below a horizontal width of eight visible pinned tabs if there are any! Just detach the tab that you want to resize to solve this ...
For a web developer, in order to test the responsiveness of their website in mobile or tablet whose size is less than 500px or minimum width then use developer tools to test in small screens.
For testing, go to developer tools and press ctrl+shift+M or click the device icon at the top left of the developer tools screen to toggle device mode. If the device icon is in blue colour, then you can test your website responsiveness by changing the browser window.
This is my first contribution to the Stack Overflow community, and it is my effort to give back to all you wonderful people who have made internet such a powerful tool.
Now to answer:
Safari, has this cool feature.
You need to activate safari developer option in preferences.
Screenshot of setting up preferences in Safari to activate developer menu
Once activated you can access bunch of very powerful developer tools.
One of this tool is Viewport adjustment which can used to test your website responsive layout.
To activate responsive lay out testing, one can use the shortcut Command+Ctrl+R
to activate safari view port adjustment option.
This will give you enough control to test your website on various view port sizes.
Screen shot of how your browser window will look once responsive layout test option is activated.
Link to how to activate developer menu in safari:
https://coolestguidesontheplanet.com/safari-web-developer-tools-show-dock-browser-window/
A lot of smart phones scale the page to fit into their screen size using zooming. Your minimum page width is probably 400px. Without any example code, I think that's all that can be said.

I don't want pop up window to be resizable

I have a popup window which appears after clicking on a button. I don't want the pop up window though to be resizeable. I tried using in css resize:none and resizable:none but this does not work for all browsers.
Is there a css element that can be used so that pop window can not resizable in all browsers, or is there a lot of different ressizeable related css elements so that I can use them so eventually all pop up windows are not resizable in all broswers?
I know where to put the css elements, in the window.open function, I just want to know other css ways that can make pop up windows not resizable for all browsers
Browsers using (all latest browsers): IE, Firefox, Google Chrome, safari and Opera
You can't do this with CSS - you need to pass the resizable parameter to your window.open() function. If you're using an anchor with the target attribute, you need to use JavaScript instead.
JS Example
window.open ("http://URL","mywin","menubar=1,resizable=0,width=350,height=250");
JS & HTML Example
<a href="#"
onclick="window.open ('http://URL','mywin','resizable=0,width=350,height=250')">Open</a>
Additional Resources
Take a look at the window.open docs on MDN: https://developer.mozilla.org/en/DOM/window.open
According to MDN, Firefox will not support the resizable attribute:
resizable
If this feature is set to yes, the new secondary window
will be resizable. Note: Starting with version 1.4, Mozilla-based
browsers have a window resizing grippy at the right end of the status
bar, this ensures that users can resize the browser window even if the
web author requested this secondary window to be non-resizable. In
such case, the maximize/restore icon in the window's titlebar will be
disabled and the window's borders won't allow resizing but the window
will still be resizable via that grippy in the status bar.
Starting
with Firefox 3, secondary windows are always resizable ( bug 177838 )
Firefox doesn't support this.
have a look here:
how can we disable resizing of new popup window in firefox?
futher more, it's a bad idea to make it not-resizeable. what if your users are visually impaired have have there settings to have large fonts?
Better late than never. Got this working:
window.addEventListener('load', () => {
const popup = window;
console.log(popup);
popup.addEventListener("resize", () => {
popup.resizeTo(306, 512);
})
});

Fullscreen webpage presentation

I am developing a web system for training and the trainer can show the content by zooming with the css3 property that increases the size of the screen.
What I'm trying to achieve is a PowerPoint style presentation, which fills the screen. The problem is that my webpage can be a combination of HTML, Flash, image or audio, or even 4 at a time.
How can I accomplish this? One idea I have is to create an image of the contents of the webpage and attach it to a flash and put it in full screen. Is there a better solution or maybe some software or something?
Thanks in advance for the help.
EDIT
I know browser have the functionality to go full screen, but what I'm trying to do is take a part of the webpage (because in the page are the menu, toolbars, etc) that is in a div.
HTML5 Fullscreen API:
http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/
// mozilla proposal
element.requestFullScreen();
document.cancelFullScreen();
// Webkit (works in Safari and Chrome Canary)
element.webkitRequestFullScreen();
document.webkitCancelFullScreen();
// Firefox (works in nightly)
element.mozRequestFullScreen();
document.mozCancelFullScreen();
// W3C Proposal
element.requestFullscreen();
document.exitFullscreen();
Also, check out this for making a presentation with HTML5:
http://slides.html5rocks.com/#landing-slide
It seems to me that it's best to let the user control this. F11 works in all browsers (that I know of) to toggle full-screen on and off.
HTH
Most browsers support pushing F11 to go into full screen mode....
Most web browsers have a full screen mode - hit F11 on a Windows machine with either Internet Explorer or Firefox and they will go full screen. Hit escape to exit full screen.
You may also want to conside using S5 ( http://meyerweb.com/eric/tools/s5/ ) to make HTML based presentations.
Good luck!
https://www.w3schools.com/howto/howto_js_fullscreen.asp
This use element.requestFullscreen() method

How to set browser window size larger than the screen resolution in Windows XP?

I would like to set browser size (mainly width) larger than the screen resolution in Windows XP. It looks like there is no easy way of dragging the browser window and resizing it. It resizes to maximum width and height of the actual screen, but no larger.
I need to check and test some webpages on large screens, but I have only a small notebook of my own. Is there a way how to accomplish a larger browser window? Preferrably in Chrome, but any browser in Windows will do.
This problem can be solved in two ways: -
1. Universal browser solution
Create a dummy html page
Add an iframe to its body with the width and height attributes set to the desired dimension
Set the iframe's src attribute to the page you want to test
2. Individual browser's developer tools
Chrome
Open the developer tools using Ctrl + Shift + i
Click the second button top left that looks like a mobile phone
Drag the width to the desired width and refresh the page (F5)
Internet Explorer
Press F12
Go to the emulation tab
Change the resolution dropdown to the desired resolution
Reduce the height of the developer tools bar until the horizontal scrollbars appear
Firefox
Open the developer tools using Ctrl + Shift + i
Press the third icon in the icons on the top right of the developer tools called "Responsive Design Mode"
Choose the resolution in the top left dropdown selector on the top left of the webpage viewport.
I am testing another resolution by zoom out - every browser supports ctrl + and ctrl -
This is possible. First 'restore' (i.e. unmaximize) the window. Then you can simply adjust the width and height of the browser by using the edges of that particular window as you like.
This applies to any browser and application windows including google-chrome.
It seems like this doesn't work for every user. There's a tool called uuspy to do this as suggested in here. I haven't try on how to do this. But, since the ui of uuspy looks not that user-friendly here's quick tip.
Open uuspy.
There, in the main window, you'll see a search box. Type the first few letters of the current 'title' of the browser there (like 'test - Google Search'), and then click refresh.
It'll show a list of windows and child-windows of processes containing the searched partial title in the title-bar.
Click on the relevant one (the root/parent is the one most likely.) Then, click GetInfo.
There's two text panes there. On the left pane, there's WS_THICKFRAME. unselect it and then click setStyle.
That will freeze the resizing. I think you'll have to read the original SO answer to know exactly what needs to be done.
simple! "restore" the window to any size, drag the window so that bottom/left corner is off-screen, then resize using top and right sides to make the window ever bigger. if you need it even bigger, just drag the window again so that bottom/left corner is even further off screen.
I managed to resize the Chrome window using ScreenSpace from dandeware.com (no affiliation). There's a free lite version as well as a paid version.
After you install Screenspace, select the Chrome window and press Ctrl-Alt-R. The software then shows a virtual window and lets you resize the Chrome window in any direction beyond the virtual window. Click on the green checkmark and the Chrome window will have the same size on your physical screen.
You can change zoom of the browser or do something like this:
var desiredWidth = 1368;
document.querySelector('html').style.width = desiredWidth+'px';
In Firefox Responsive Design Mode
Menu -> Developer -> Responsive Design Mode (Ctrl-Shift-M)
gives you a drop-down to select the window size.
copy of answer to https://superuser.com/questions/1263519/how-to-create-a-1280x800-screenshot-of-a-chrome-browser-viewport/1263523
Here's another solution.
Under Linux you can freely resize the windows without any hindrance. It also has Mozilla Firefox and Google Chrome, and are almost equal in functionality to the Windows versions more or less. So, my suggestion is try this with a Linux flavor such as Ubuntu or Linux Mint. May be you can try this via the LiveCD as well. That way, you don't have to worry about installing a new OS! I can help with that if you need.
And, I found this handy bookmarklet that resizes the browser to standard screen sizes such as 800x600 etc.
if you have a dual moniter setup and set the resolution higher on one, then you can drag the size of the window on the smaller screen to the size of the larger so it will get bigger than the smaller screen -this is haw i do it with windows 7