Php 数据标题的自定义位置?
我使用数据标题属性来提示用户他看到的元素 问题是,多亏了我的剧组,标题没有正确显示,只是其中的一部分,就像其他剧组后面显示的一样 有没有办法让标题出现在所有东西的前面,比如说,给它一个自定义的位置 提前谢谢 编辑: 这是css的代码Php 数据标题的自定义位置?,php,jquery,html,css,Php,Jquery,Html,Css,我使用数据标题属性来提示用户他看到的元素 问题是,多亏了我的剧组,标题没有正确显示,只是其中的一部分,就像其他剧组后面显示的一样 有没有办法让标题出现在所有东西的前面,比如说,给它一个自定义的位置 提前谢谢 编辑: 这是css的代码 a { color: #900; text-decoration: none; } a:hover { color: red; position: relative; } a[data-title]:hover:after { content
a {
color: #900;
text-decoration: none;
}
a:hover {
color: red;
position: relative;
}
a[data-title]:hover:after {
content: attr(data-title);
padding: 4px 8px;
color: #333;
position: absolute;
left: 0;
top: 100%;
white-space: nowrap;
z-index: 20px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}
我解决了部分问题,是z指数。只是需要删除px,所以现在至少它显示在所有元素前面
现在的问题是,由于div,它显示得离鼠标很远
那么,我怎样才能让它像普通的标题一样出现在鼠标旁边呢?@hjpotter92就在那里。还要编写基本的html和JSif。你能在a中重现这个问题吗,因为这里显示的代码到目前为止没有显示任何缺陷。@LinkinTED如你所说,它没有显示任何流,问题是我的div,但是如果我更改它们,一切都会改变,我怎样才能让它像一个正常的标题?