在 HTML <area> 上设置背景颜色元素? [英] Set a background color on the HTML <area> element?
问题描述
有没有办法为 HTML 元素设置背景颜色?我正在创建一个图像地图,其中当您将鼠标悬停在地图的某些部分时会弹出一个工具提示,我认为如果我可以为
设置背景颜色会很酷(也很方便);
元素,以便您可以看到它们在图像上的位置.
Is there any way to set a background color for the HTML <area>
element? I'm creating an image map where certain sections of the map will pop up a tooltip when you mouse over them, and I thought it would be cool (and convenient) if I could set a background color for the <area>
elements so you could see where they were located over the image.
我尝试了背景颜色和边框,但都没有任何效果 - 元素保持不可见".我假设这是因为
是一个自闭合标签,所以它实际上没有任何尺寸?但是强制设置高度和宽度也无济于事.
I've tried both background-color and border, and neither have any effect - the <area>
elements remain "invisible." I'm assuming this is because <area>
is a self-closing tag and so it doesn't actually have any dimensions? But forcing a height and width didn't help, either.
推荐答案
你可以用div(set postition:absolute)
代替area
u can use div(set postition:absolute)
instead of area
这篇关于在 HTML <area> 上设置背景颜色元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!