图像标签的标题属性不起作用? [英] Not working Title attribute for image tag?

查看:154
本文介绍了图像标签的标题属性不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序面临一些奇怪的问题.我有一张图片

I am facing bit strange problem with my application. I have an image

<img title="New (Alt+N)" alt="New (Alt+N)" src="images/icon_new.gif" tabindex="-1" id="Ax14490_image">

可以使用firebug检查此代码.

This code is found inspecting document withfirebug.

可以正确显示,但鼠标悬停在该图像上时标题不会出现.在这种情况下,谁能帮助我.

which is displaying properly but title is not coming on mouseover of that image. can any one help me out in this context.

我正在使用firefox 4.0浏览器

I am using firefox 4.0 browser

推荐答案

如果其他任何人都通过搜索找到了该线程,则我遇到的问题与原始发布者所描述的相同.就我而言,这就是原因.

In case anyone else finds this thread via a search, I was having the same problem as described by the original poster. Here's what turned out to be the cause, in my case.

我的布局涉及水平彼此相邻放置的两个div对象.一个在左边,另一个在右边.左div的宽度设置为100%,尽管由于内部填充,其内容并未覆盖所有空间.右边的div包含不会触发任何鼠标事件的img(包括"title"属性不起作用,但是onMouseOver和onMouseOut也不起作用.)

My layout involved two div objects placed horizontally next to one another. One on the left, and the other on the right. The left div was set to have a width of 100%, although it's contents did not cover all of that space due to internal padding. the right div contained the img which was not triggering any mouse events (including the "title" attribute not working, but onMouseOver and onMouseOut also did not work.)

所以这是由于z排序.鼠标事件改为由左侧的div对象处理,因为它的100%宽度包含整个浏览器窗口.由于左div的位置"属性为绝对",因此可以合法设置其z值,因此我将其z值设置为"-1".这样就解决了这个问题.

So this was due to z-ordering. The mouse events were instead being handled by the div object on the left, because it's 100% width encompassed the full browser window. Since the left div had a "position" attribute of "absolute", it could legally have it's z-value set, and so I set its z-value to "-1". This fixed the issue.

这篇关于图像标签的标题属性不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆