Html标题属性显示流入,内部元素,当嚎叫它 [英] Html title attribute showing up in-flow, inside element, when howering over it
问题描述
我使用title属性为了显示工具提示:
I'm using the title attribute in order to display a tooltip:
.remove_button{
background-color:#ff3300;
color:#ffffff;
font-family:Courier New,sans-serif;
font-weight:900;
font-size:20px;
float:right;
border-radius:5px;
padding:0px 6px 0px 6px;
margin-right:15px;
}
<div class="remove_button" title="Remove">x</div>
但是标题显示在元素内
------x------ :When not hovering
------xRemove------ :When hovering
one '-' is one pixel of padding
我误解了最后一次我问,但是要清楚指出,标题不会显示在内容的其余部分上,但它显示在实际按钮内的流。这不是一个标题通常如何工作。
I got misunderstood the last time I asked, but to point it out clearly, the "title" isn't showing up above the rest of the content but it's showing up in-flow inside the actual button. This is not how a title usually works.
编辑:
我发现了问题,但这小块代码没有影响任何我的其他'
I found the problem, but this little piece of code hasn't affected any of my other 'title tooltips', how could that be?
*[title]:hover:after{
content:attr(title);
background-color:#feeba6;
color:#333333;
}
上述代码的用途是为工具提示设置样式, t似乎发生。无论如何,这只是我在谷歌上发现的一些废话我想。
The purpose with the above code was to style the tooltips, but that doesn't seem to happen. Anyway, it was just some crap I found on google I suppose.
推荐答案
你确定,否则,可能会混淆浏览器。
您可以尝试创建一个文件,只有那段代码,看到那个工作
Are you sure, that you haven't got anything else, that can confuse the browser.
You could try to create a file, only with that snippets of code, and see that works
这篇关于Html标题属性显示流入,内部元素,当嚎叫它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!