Go back one step. I have the background of the images, for a wide screen, made as follows:-
<style type="text/css"> .images { position: absolute; height: 77%; width: 39%; right: 2.5%; bottom: 6.8%; top: 16%; background-color: #98FF98; } </style>
<div class="images"></div>
If I add the following and reduce the screen width the background repositions, just the way I want, and I want the photo to do the same.
<style>@media screen and (max-width:800px) { .images { position: absolute; height: 47%; width: 96%; left: 2%; top: 16%; background-color: #98FF98; } }</style>
This is the coding for the photo for a wide screen and everything works good:-
<style type="text/css"> .pha { position: absolute; width: 6%; right: 8.2%; top: 18.5%; } </style>
<div class="pha"><img alt="Photo" src = "/img/soda.jpg" style="width:160%;" ></div>
But if I narrow the screen the photo is too small, so I have the next page for narrow screens, as follows:-
<style type="text/css"> .pha { position: absolute; width: 6%; left: 7.2%; top: 17%; } </style>
<div class="pha"><img alt="Photo" src = "/img/soda.jpg" style="width:285%;" ></div>
So when the screen narrows I want the lower percentages to apply, either by CSS or Javascript. The only difference between those blocks of codings, or elements as you might call them, is the number % in other words right: 8.2%; changes to left: 7.2%; and top: 18.5%; changes to top: 17%; etc etc.
By the way my codings must be the same as yours otherwise nothing will work for me. My only difference is that I dont have the style code in the header and dont have an external sheet.
If you still dont understand, tomorrow Iāll post the entire codings but only for the problem I have (not for the entire page otherwise there will be too much code), and try to post some screenshots.