在HTML中按钮处于活动状态时,向按钮添加提示

时间:2013-01-25 07:23:32

标签: javascript html css button tooltip

enter image description here

enter image description here

如何在活动时向第二个图像添加提示。我试过这个example来显示提示但我没有帮助我的要求。

感谢。

2 个答案:

答案 0 :(得分:1)

试试这个

<强> HTML

<div id="pointed"> Arrow </div>

<强> CSS

#pointed {
    position: relative;
    margin: 0 auto;
    width: 200px;
    height: 200px;
    background-color: black;color:white
}

#pointed::after {
    position: absolute;
    top: 100%;
    left: 30%;
    content: '';
    width: 0;
    height: 0;
    border-top: solid 10px black;
    border-left: solid 10px transparent;
    border-right: solid 10px transparent;
}

<强> DEMO

答案 1 :(得分:0)

try this

<div id="pointed"> <a href="#">Arrow </a></div>

#pointed {
position: relative;
margin: 0 auto;
width: 200px;
height: 200px;
background-color: black;color:white
          }

#pointed:active::after {
position: absolute;
top: 100%;
left: 45%;
content: '';
width: 0;
height: 0;
border-top: solid 10px black;
border-left: solid 10px transparent;
border-right: solid 10px transparent;
}