I am trying to build an hybrid app and I need to get the size of a specific porition of the background.
- The background has those properties :
background-size: 100% 100%; background: url('back.jpg') no-repeat center center fixed;
- I would like to place a div over that background and set the size of the div to the size of a precise portion of the background.
Here is an image to clarify what I would like to do : Background example with a red rectangle on it
The red rectangle on the backgroud image above is an example of the portion of the image I would like to calculate the size on a responsive screen.
I know how to make the elements follow the right absolute position on the background thanks to this topic Position element over background image, but not how to resize them to the right scale.
Can anyone help ?