Test Layouts By Resizing Your Browser Window with JavaScript

Test Website Layouts

Website visitors browse with many different screen resolutions, largely determined by the size of their monitor. You should test your website’s layout to make sure that it doesn’t break of look wrong when viewed using the most common screen resolutions.

So how do you test that? Change your own screen resolution a handful of times to see what happens? There is an easier way, thanks to a little piece of JavaScript!

Change Your Screen Resolution

You could reset your own screen resolutions and check your website design that way. But that would be a lot of hassle. On the other hand you could resize your web browser to replicate the effect of a different screen resolution. But how do you know when you’ve resized your browser to the desired height and width?

JavaScript Can Resize Your Web Browser

Using JavaScript it’s possible to resize your web browser to the precise size that you want to test. Enter the code below into your address bar and your web browser will be resized accordingly!

javascript:resizeTo(800,600)

Change the numeric values to alter the width and height, respectively.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Note: if you want to post PHP or ASP code including the opening tags (<?php etc...) you must use the HTML entity for the left chevron (<) - &lt; - or your code will be stripped out!