1

As the title says, is it possible to position an image in the center of the screen rather than the center of the browser?

This means if your browser wasn't open full screen (lets assume the browser is only using 3/4 of your screen), the image would not appear in the middle of the browser window, but rather in the middle of your actual screen. This means the image might be positioned near the right edge of your browser window.

Thank you.

2 Answers2

1

You can get the screen resolution and measure image position depending on this. Look to this

How to detect the screen resolution with JavaScript?

Community
  • 1
  • 1
PashaB
  • 111
  • 4
0

You cannot position anything outside of the viewport unless you open a new window. If your question is referring strictly to an image element only. The answer is No. Anything positioned outside of the browser viewport will cause horizontal scrolling inside the viewport.

On desktop, you can however open a popup window in the middle of the screen the size of your image, with your image in it.

Community
  • 1
  • 1
hexalys
  • 4,898
  • 3
  • 26
  • 54