Skip to content

Instantly share code, notes, and snippets.

@jimschubert
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimschubert/9379126 to your computer and use it in GitHub Desktop.
Save jimschubert/9379126 to your computer and use it in GitHub Desktop.
A simple image loader for New Tab Redirect user.

Place this file in the same directory as your image.

Place the name of your file within the quotes of the image HTML tag. For example, if your image is cats.jpg, your file would look like:

<html>
<style>
img { max-width:100%; max-height:100%; margin-left:auto; margin-right:auto; display:block;}
</style>
<body>
  <img src="cats.jpg"/>
</body>
</html>

This auto-fits the height of the image. Because browser don't remain the same dimensions ratio (e.g. 3:4), there's no reliable way to resize the image to the size of the browser (it would appear 'stretched').

Then, point your redirect URL to load.html instead of your image name. You should be all set!

<html>
<style>
img { max-width:100%; max-height:100%; margin-left:auto; margin-right:auto; display:block;}
</style>
<body>
<img src=""/>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment