我的图像导航是否错过了一些东西?它不可点击

发布于 2025-02-02 16:53:12 字数 476 浏览 4 评论 0原文

有人可以帮我下面吗?我的图像不可点击,但我不确定为什么?

<img src= "makeup.html.jpg" alt= "Make up by Lauren Evans logo" title= "Make up by Lauren Evans"
 width= "300" height= "300" class= "floattoright" usemap= "MakeupbyLaurenEvans" />

 <map name= "Make up by Lauren Evans">
    <area shape= "rect" coords= "0, 0, 230, 218" href= "https://www.instagram.com/makeupbylaurenevans/?hl=en" 
     alt="Make up by Lauren Evans Instagram" />
 </map>
    

Can someone please help me with the below? My image is not clickable but I'm not sure why?

<img src= "makeup.html.jpg" alt= "Make up by Lauren Evans logo" title= "Make up by Lauren Evans"
 width= "300" height= "300" class= "floattoright" usemap= "MakeupbyLaurenEvans" />

 <map name= "Make up by Lauren Evans">
    <area shape= "rect" coords= "0, 0, 230, 218" href= "https://www.instagram.com/makeupbylaurenevans/?hl=en" 
     alt="Make up by Lauren Evans Instagram" />
 </map>
    

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

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

发布评论

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

评论(3

旧情别恋 2025-02-09 16:53:12

检查以下代码:

<img src= "https://images.unsplash.com/photo-1653853504933-1241ec829d7c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=872&q=80" alt= "Make up by Lauren Evans logo" title= "Make up by Lauren Evans"
 width= "300" height= "300" class= "floattoright" usemap= "#MakeupbyLaurenEvans" />

 <map name= "MakeupbyLaurenEvans">
    <area shape= "rect" coords= "0, 0, 230, 218" href= "https://www.instagram.com/makeupbylaurenevans/?hl=en" 
     alt="Make up by Lauren Evans Instagram" />
 </map>

Check the following code:

<img src= "https://images.unsplash.com/photo-1653853504933-1241ec829d7c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=872&q=80" alt= "Make up by Lauren Evans logo" title= "Make up by Lauren Evans"
 width= "300" height= "300" class= "floattoright" usemap= "#MakeupbyLaurenEvans" />

 <map name= "MakeupbyLaurenEvans">
    <area shape= "rect" coords= "0, 0, 230, 218" href= "https://www.instagram.com/makeupbylaurenevans/?hl=en" 
     alt="Make up by Lauren Evans Instagram" />
 </map>

如梦亦如幻 2025-02-09 16:53:12

实际上,它是可单击的,但是您没有onclick可以处理它,并且光标:指针;造型也缺少。我添加了样式和一些虚拟点击处理程序。

img {
    cursor: pointer;
}
<img src="https://cdn.nwmgroups.hu/s/img/i/2205/20220525huha-jel1.jpg?w=1280&h=720&t=4" alt= "Make up by Lauren Evans logo" title= "Make up by Lauren Evans"
 width= "300" height= "300" class= "floattoright" usemap= "MakeupbyLaurenEvans" onclick="alert('I was clicked')" />

 <map name= "Make up by Lauren Evans">
    <area shape= "rect" coords= "0, 0, 230, 218" href= "https://www.instagram.com/makeupbylaurenevans/?hl=en" 
     alt="Make up by Lauren Evans Instagram" />
 </map>
    

Actually it's clickable, but you have no onclick event to handle it and the cursor: pointer; styling is also missing. I have added the styling and some dummy click handler.

img {
    cursor: pointer;
}
<img src="https://cdn.nwmgroups.hu/s/img/i/2205/20220525huha-jel1.jpg?w=1280&h=720&t=4" alt= "Make up by Lauren Evans logo" title= "Make up by Lauren Evans"
 width= "300" height= "300" class= "floattoright" usemap= "MakeupbyLaurenEvans" onclick="alert('I was clicked')" />

 <map name= "Make up by Lauren Evans">
    <area shape= "rect" coords= "0, 0, 230, 218" href= "https://www.instagram.com/makeupbylaurenevans/?hl=en" 
     alt="Make up by Lauren Evans Instagram" />
 </map>
    

空‖城人不在 2025-02-09 16:53:12

问题是代码。如您所见,您可以看到 example

usemap属性中,您需要添加喜欢usemap =“ #makeupbylaurenevans” usemap =。然后在地图标签中,名称应与您在usemap属性中定义的属性相同:

name =“ Makepbylaurenevans”

现在,代码外观像这样:

<img src= "makeup.html.jpg" alt= "Make up by Lauren Evans logo" title= "Make up by Lauren Evans"
 width= "300" height= "300" class= "floattoright" usemap= "#MakeupbyLaurenEvans" />

 <map name= "MakeupbyLaurenEvans">
    <area shape= "rect" coords= "0, 0, 230, 218" href= "https://www.instagram.com/makeupbylaurenevans/?hl=en" 
     alt="Make up by Lauren Evans Instagram" />
 </map>

工作示例

There is issue is the code. As you can see from this example.

In usemap attributes you need to add map tag name with # like usemap= "#MakeupbyLaurenEvans". Then in the map tag, name should be same as you defined in usemap attribute like this:

name= "MakeupbyLaurenEvans"

Now, the code looks like this:

<img src= "makeup.html.jpg" alt= "Make up by Lauren Evans logo" title= "Make up by Lauren Evans"
 width= "300" height= "300" class= "floattoright" usemap= "#MakeupbyLaurenEvans" />

 <map name= "MakeupbyLaurenEvans">
    <area shape= "rect" coords= "0, 0, 230, 218" href= "https://www.instagram.com/makeupbylaurenevans/?hl=en" 
     alt="Make up by Lauren Evans Instagram" />
 </map>

Working Example

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