如何在div标签中映射背景图像

发布于 2024-09-08 23:26:57 字数 117 浏览 0 评论 0原文

我想创建一个您可以单击并转发到“#”的框,所以我认为这是一个好主意:

但不幸的是,区域地图不能在 div 或 p 标签中使用:/ 有人知道什么是好的解决方案吗?

I wanted to create a box that you could click on and be forwarded to "#" so I thought this would be a good idea:

But unfortuneatly areamaps couldn't be used in div or p tags :/
Anyone have an idea what a good solution would be?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

桜花祭 2024-09-15 23:26:57

这与 php 无关,因为它发生在导航器中。
使用 JavaScript 代替:

<div style='background:url(image.jpg)' onclick='function(){document.location.replace="#"}'> </div>

This is not php related, because its happening in the navigator.
Use javascript instead :

<div style='background:url(image.jpg)' onclick='function(){document.location.replace="#"}'> </div>
鸩远一方 2024-09-15 23:26:57

您可以在 div 内创建标签。您可以提供这些子标签和 id,或者在标签的 style 属性中应用样式。将标签样式设置为display:block,并通过position:absolute或position:relative以及属性top:5px和left:5px来定位链接。适当设置宽度和高度以及顶部和左侧。

You could create tags inside the div. You can give these subtags and id or you apply the style in the tag's style attribute. Set the tags style to display:block and position the link via position:absolute or position:relative and the attributes top:5px and left:5px. Set width and height and top and left appropriately.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文