0

I have area code for map in html, and i need to add class for this like:-

<area shape="rect" coords="<?php echo $coords; ?>" href="javascript:void(0);" id="poplink_<?php echo $units_id; ?>" <? if ($status_units == "sale"){?> class="sale" <? } elseif ($status_units == "was_book"){?> class="was_book" <? } else {?> class="was_sale" <? } ?>> 

In PHP is print like:-

<area shape="rect" coords="<?php echo $coords; ?>" href="javascript:void(0);" id="poplink_<?php echo $units_id; ?>" class="sale" > 

And class is like:-

.sale{ background: url(../images/sale.png);
background-position: 97% center;
background-repeat: no-repeat;
padding-right: 34px;
display: inline-block;
position: relative;
cursor: pointer;}
.was_book{ background: url(../images/was_book.png);
background-position: 97% center;
background-repeat: no-repeat;
padding-right: 34px;
display: inline-block;
position: relative;
cursor: pointer;}
.was_sale{ background: url(../images/was_sale.png);
background-position: 97% center;
background-repeat: no-repeat;
padding-right: 34px;
display: inline-block;
position: relative;
cursor: pointer;}

I have picture that show all available hose to sale, and i need to add markers for sale house, Like google map.

The error is, The images of class not show . why !!!

  • `area` is not generally a style-able element; it's used to pick define a hotspot within an image map. If you need to position an image over a `map`, you're better off using an absolute-positioned `div`. See http://stackoverflow.com/questions/7019947/set-a-background-color-on-the-html-area-element (about setting the background *color*, but the principle is the same). – Paul Roub Oct 29 '14 at 18:57
  • But the are is in loop and i need for every area some class, some time i add sale, some time is was_sale, So i need solution for it – Rasha Sami Oct 29 '14 at 19:01
  • I understand you really want `area` to work that way, but it doesn't, no matter how badly you want it to. You could achieve the results that (I think) you want using `div` tags, absolutely positioned, with the same classes. The loop has nothing to do with whether or not an `area` can have a background image. – Paul Roub Oct 29 '14 at 19:03
  • i do this `
    ` but the icon not show
    – Rasha Sami Oct 29 '14 at 19:09
  • You are already using a `class` attribute in `area` element. What you actually want is some styling, and you should reformulate your question (and its title) to say that. Note that there most probably is no pure HTML + CSS solution to the actual problem you seem to have, so you should specify which other techniques are acceptable. – Jukka K. Korpela Oct 29 '14 at 19:19
  • I have picture that show all available hose to sale, and i need to add markers for sale house – Rasha Sami Oct 29 '14 at 19:32

0 Answers0