This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Currently, it is hard to position an element relative to an image of unknown width/height without using JavaScript. If you wish to have an element on top of an image (e.g. an icon to trigger an activity), it would be nice to do something along the lines of <img src="whatever.png" alt="something"> <div style="position: relative; left: 5%; top: 5%; width: 45%; height: 45%; background-color: green; opacity: 0.8;">something</div> </img> (Replacing the img with a div with the image set as background-image works for placing the inner div, but there doesn't seem to be a way to force the div to have the exact size of the image without JavaScript.)
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the Editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the Tracker Issue; or you may create a Tracker Issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Rejected Change Description: none Rationale: It's likely impossible to achieve that in that manner. Using script in order to solve this does not strike me as a major problem, but at any rate a better solution would come from CSS.