Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have an image that iclude a Vertical Oval. i want to show text in Vertical Oval. my image is responsive so oval should be responsive. "image responsive on vertical" please help me. tnx here is my code:
HTML
<html lang="en">
<head>
<script src="_js/jquery.min.js"></script>
<script src="_js/jquery.rwdImageMaps.js"></script>
<title>About Me</title>
<style>
.responsive_image {
height: 100%;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
}
h3 {
position: absolute;
top: 126px;
width: 47%;
height: 920px;
bottom: -231px;
right: -379px;
margin:auto;   
}
</style>
</head>
<body>
<div>
<img class="responsive_image" src="pics/About.jpg" alt="" usemap="#Map"   />
<h3 style="width: 38%; height: 131%; ">some text</h3></div>
<map name="Map">
<area shape="circle" coords="1386, 749, 33" href="home.html">
</map>
</body>
<script>
$(document).ready(function (e) {
    $('img[usemap]').rwdImageMaps();
});
</script>
</html>
Posted

1 solution

"Add text in oval" is something which makes no sense. The elements of <map> are the elements which define pure geometry, nothing visible, and they cannot have any visible children. They are only used to define clickable areas. Please see:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map[^].

The maps are linked with some images which can have usemap attribute pointing to the map selected by its name attribute, the way it is shown in the code sample shown in the article referenced above. This is a whole idea: if some part of image is clickable, it's natural that the image is what should provide the visual feedback. If you need something else, you should probably use different technique, such as HTML5 Canvas or HTML-embedded SVG.

Therefore, I don't even want to describe another possibility: to overlay some text element over the image using absolute positioning. It's quite possible, but would be an apparent abuse of otherwise much simpler technique.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900