设计带箭头的工具提示

3

点击此链接查看我要设计的工具提示

你好,我的工具提示存在问题,箭头不显示,而且我不知道如何将箭头置于工具提示前面。我附上了一个我要设计的工具提示的图片。我开始学习HTML5和CSS3,有人能帮忙吗?

  a.tooltips {
  position: relative;
  display: inline;
}
a.tooltips span {
  position: absolute;
  width:140px;
  color: #FFFFFF;
  background: #000000;
  height: 73px;
  line-height: 73px;
  text-align: center;
  visibility: hidden;
  border-radius: 3px;
}
a.tooltips span::before {
  content:"\2190";
  position: absolute;
  top: 100%;
  left: 50%;
 margin-left: -8px;
  /* width: 0; height: 0;
  border-top: 8px solid #000000;
  border-right: 8px solid transparent;
  border-left: 8px solid transparent; */
}
.span-content:after {
  font-family: FontAwesome;
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
}
.wrap-content{
position:relative
}
a:hover.tooltips span {
  visibility: visible;
  opacity: 0.4;
  bottom: 30px;
  left: 50%;
  margin-left: -76px;
  z-index: 999;
}
.wrap-arrow{
  
widows:50px ;
height:50px ;
}
span.arrowup{
 background-image: url('arrowup.png') ;
} 
 <div style="margin-top:200px;margin-left:200px" >
    <a class="tooltips" href="#">bankcheck
        <span>Tooltipbankcheck</span></a>
        <span class="wrap-content span-content"></span></a>
        <span class="wrap-arrow arrowup"></span>
    </div>


{btsdaf} - Terry
{btsdaf} - Master Yoda
1个回答

0

我希望问题与定位有关。请参考下面的代码片段。

a.tooltips {
  position: relative;
  display: inline;
}

a.tooltips span {
  position: absolute;
  width: 140px;
  color: #FFFFFF;
  background: #000000;
  height: 73px;
  line-height: 73px;
  text-align: center;
  visibility: hidden;
  border-radius: 3px;
}

a.tooltips span::before {
  content: "\21D3";
  position: absolute;
  bottom: -50%;
  left: 50%;
  color: red;
}

.span-content:after {
  font-family: FontAwesome;
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
}

.wrap-content {
  position: relative
}

a:hover.tooltips span {
  visibility: visible;
  opacity: 0.7;
  bottom: 30px;
  left: 50%;
  margin-left: -76px;
  z-index: 999;
}

.wrap-arrow {
  widows: 50px;
  height: 50px;
}

span.arrowup {
  background-image: url('arrowup.png');
}
<div style="margin-top:200px;margin-left:200px">
  <a class="tooltips" href="#">bankcheck
        <span>Tooltipbankcheck</span></a>
  <span class="wrap-content span-content"></span></a>
  <span class="wrap-arrow arrowup"></span>
</div>


{btsdaf} - Y.Bohui
{btsdaf} - Y.Bohui
{btsdaf} - RaJesh RiJo
没问题,我该如何调整内容图标的大小? - Y.Bohui

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接