Moiré
Moiré

Reputation: 75

How to create a webpage that is only an image and nothing else

How does one create a webpage that is only an image and nothing else? For example, on the website https://just-read.it/, the index page is an image and nothing else. It displays like you've opened a direct link to an image, not like putting an <img/> tag in an html file. How can this be done?

Upvotes: 1

Views: 2998

Answers (2)

Nate
Nate

Reputation: 1

You could two this two ways.

  1. Create a webpage with an image. Like this:

<img src="example.jpg" alt="example image">

  1. Create a page that redirects to an image

<button onclick="myFunction()">Click Me!</button>

<script>
function myFunction() {
  location.replace("http://pages.artyserver.com/bee.jpg")
}
</script>

Hope this helped!

Upvotes: 0

Daniel Smit
Daniel Smit

Reputation: 43

For Apache/PHP servers, this can be done through the .htaccess file.

Pages can be redirected without changing the address in the URL bar. In this case it would be redirected to the image.

See here for more details (instead of redirecting to a .html or .php page it would be to an image).

This method is an alternative for Node.js.

Upvotes: 2

Related Questions