我有一张瓷器柜的图片。
使用图像映射我可以绘制点并制作 hrefs:
<area id="vasetop" alt="" title="Vase on Top" href="#" onClick="reply_click(this)" shape="rect" coords="276,27,379,96" style="outline:none;" target="_self" />
我有包含所有元素名称的数据库,如果可用,则每个元素的值为 0,如果不可用,则为 1。
我想做的是如果说:
vasetop 的值为 1 我想以某种方式将其删除。
我的代码看起来像
$result = mysqli_query($con,"SELECT * FROM stuff where status='1'");
while($row = mysqli_fetch_array($result)) {
if ($row['items'] == "vasetop"){
<area show black box at these coords="276,27,379,96" />
}
else {
<area id="vasetop" alt="" title="Vase on Top" href="#" onClick="reply_click(this)" shape="rect" coords="276,27,379,96" style="outline:none;" target="_self" />
}
}
接近那个的东西。
有没有办法在html中设置坐标的背景颜色?
我真正想要的是一些可以执行以下操作的代码。
<div coords="276,27,379,96" style="background-color: #FFFFFF;">
最佳答案
您可以将绝对定位的 div 放置在您的 map 顶部,例如:
<div style="position:absolute;
top:27px;
left:276px;
width:103px; /*379-276*/
height:69px; /* 96-27 */
background:#fff;"></div>
但是只用矩形很容易,用圆形和多边形做这样的事情要棘手得多......
关于html - 更改背景颜色 HTML 区域坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28077544/