For accessibility reasons, I have an image that requires text to be overlaid on it. The image is responsive thanks to Bootstrap's img-responsive class. I need the text to stay positioned correctly on the image even as its size changes. Is there a way to achieve this using CSS?
Here's a simple example:
<style>
span#mad {
position: relative;
top: 440px;
left: 440px;
}
</style>
<span id="mad">
Madagascar
</span>
<div id="map">
<img src="http://www.freeworldmaps.net/printable/africa/countries.png"
class="img-responsive"/>
</div>
https://jsfiddle.net/DTcHh/95125/
The text label for Madagascar should always remain above the island.