I have an image marking a scale, with the marker's position in HTML set as:
<image class="red-marker" xlink:href="./assets/images/marker.png"
[attr.x]=percentage width="12" height="40" y="0" ></image>
But I want the middle of the marker to be at that position, currently its left side aligns with it. Here is a visual representation:
Marker's position when 'percentage' is 100%: Is there a way in HTML, CSS or Javascript to achieve this by:
Setting the image origin to the horizontal middle
- Using CSS's calc() on X position along with an unknown Javascript variable
- Applying position inside Javascript and referring to a variable there.
Any suggestions?