Why tool tip is not displaying for page title in 'chrome'?
I have a html page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>page title</title>
</head>
<body>
</body>
</html>
But the tool tip for title is not comming in chrome but it comes in mozilla.
if we increase the length of the page title then the tool tip display in chrome
(eg:-<title>page title title1 title2 title3 title4 title5</title>
)
can anyone 开发者_如何学JAVAsay the reason for this?
No browser I'm aware of displays a tooltip for the <title></title>
tag. You're probably confusing it with the title
attribute, e.g.:
<div title="Hello, world!">Box with title</div>
Please disregard my answer. I guess you are not talking about HTML. Some tabbed browsers, including Firefox and Chrome, display a tooltip when you put the mouse over a tab when the full title does not fit. If the title does fit, the tooltip is pointless. It's a feature, not a bug.
I don't have chrome to test but I'd wonder if it is only showing the tooltip when it is having to hide some of the page title in the tab name (assuming it is mousing over the tab that is generating the tooltip). This is mainly based on the fact that if its short it doesn't show the tooltip. There is no real spec that says what should be done with page titles though, except that they should be displayed. See http://www.w3.org/TR/html401/struct/global.html#edef-TITLE for the official spec (of HTML4) on what titles are for and how they might be rendered.
On Chrome you will not see a tool tip when you hover over the tab if the text is short enough.
There isn't really anything you can do about that, tab tooltip isn't part of specifications, and any browser can behave in another way. (In fact, it seems even Chrome isn't consistent between operating systems)
精彩评论