【问题标题】:Design tooltip with arrow带箭头的设计工具提示
【发布时间】:2017-10-24 12:13:22
【问题描述】:

嗨,我的工具提示有问题,箭头没有显示,我也不知道如何将箭头放在工具提示的前面,我包含了我想设计的工具提示的图像。我开始学习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>

【问题讨论】:

标签: javascript jquery html css


【解决方案1】:

我希望问题是关于定位的。查看下面的 sn-p 以供参考。

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>

【讨论】:

  • 我可以把内容改成精灵png吗
  • RaJesh RiJo 我尝试添加图像,但它不再起作用
  • 请用工作代码创建一个新问题或提琴手。这样可以调查一下。
  • 很好我如何调整内容图标的大小
猜你喜欢
  • 1970-01-01
  • 2015-06-24
  • 1970-01-01
  • 2017-06-16
  • 2016-08-20
  • 2019-09-07
  • 2017-02-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多