如何在锚点文本上方的锚点中显示内联跨度文本

时间:2018-09-27 09:45:31

标签: html css css3 position z-index

我创建了以下代码,请在

上进行检查

  .tooltip1 {
            z-index: 1;
            position: relative;
            
        }

            .tooltip1 .tooltiptext {
                visibility: hidden;
                width: 300px;
                min-height:172px;
                opacity: 1;
                font-size: 14px;
                border: 1px solid grey;
                background-color: lightblue;
                
               background-image:url(images/test.jpg); 
                color: black;
                text-align: left;
                border-radius: 2px;
                padding: 15px 10px 15px 10px;
                margin-top: -6px;
                margin-left: 10px;
                position: absolute;
                line-height:20px;
                z-index: 100;
                -moz-border-radius: 5px;
                /* -webkit-border-radius: 5px; */
                box-shadow: 5px 5px 5px grey;
            }

                .tooltip1 .tooltiptext:before {
                    content: '';
                    /* visibility: hidden;*/
                    display: block;
                    width: 0;
                    height: 0;
                    position: absolute;
                    border-top: 8px solid transparent;
                    border-bottom: 8px solid transparent;
                    border-right: 8px solid #133a6f;
                    left: -8px;
                    top: 7px;
                }

            .tooltip1:hover .tooltiptext {
                /* visibility: visible;*/
                visibility: visible;
            }
<a href="#" target="_blank" class="catg_title tooltip1">2016<span class="tooltiptext">The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>
<a href="#" target="_blank" class="catg_title tooltip1">2017 dfs ds fsf s <span class="tooltiptext">The The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>
<a href="#" target="_blank" class="catg_title tooltip1">2018 sdf <span class="tooltiptext">The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>
<a href="#" target="_blank" class="catg_title tooltip1">2019sdfsf sf df ds f fsdf <span class="tooltiptext">The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>
<a href="#" target="_blank" class="catg_title tooltip1">2020 dfs fsdf sdf sf sd<span class="tooltiptext">The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>

https://codepen.io/mevil311/pen/NOKjzo

我试图在段落中实现类似于popUp的Wikipedia。但是从“弹出式Tootip”(跨度文本)中可以看到“锚文本”。请帮助

2 个答案:

答案 0 :(得分:1)

只需从您的z-index: 1;中删除.tooltip1规则:

.tooltip1 {
  /* z-index: 1; ← removed */
  position: relative;
}

.tooltip1 .tooltiptext {
  visibility: hidden;
  width: 300px;
  min-height: 172px;
  opacity: 1;
  font-size: 14px;
  border: 1px solid grey;
  background-color: lightblue;
  background-image: url(images/test.jpg);
  color: black;
  text-align: left;
  border-radius: 2px;
  padding: 15px 10px 15px 10px;
  margin-top: -6px;
  margin-left: 10px;
  position: absolute;
  line-height: 20px;
  z-index: 100;
  -moz-border-radius: 5px;
  /* -webkit-border-radius: 5px; */
  box-shadow: 5px 5px 5px grey;
}

.tooltip1 .tooltiptext:before {
  content: '';
  /* visibility: hidden;*/
  display: block;
  width: 0;
  height: 0;
  position: absolute;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #133a6f;
  left: -8px;
  top: 7px;
}

.tooltip1:hover .tooltiptext {
  /* visibility: visible;*/
  visibility: visible;
}
<a href="#" target="_blank" class="catg_title tooltip1">2016<span class="tooltiptext">The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>
<a href="#" target="_blank" class="catg_title tooltip1">2017 dfs ds fsf s <span class="tooltiptext">The The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>
<a href="#" target="_blank" class="catg_title tooltip1">2018 sdf <span class="tooltiptext">The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>
<a href="#" target="_blank" class="catg_title tooltip1">2019sdfsf sf df ds f fsdf <span class="tooltiptext">The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>
<a href="#" target="_blank" class="catg_title tooltip1">2020 dfs fsdf sdf sf sd<span class="tooltiptext">The dsfsf dsf dsfsf sdf sdfds sd fsdfsdsdfff se tr kksjh sjdf jhsdf kjhdjh usehr jshdfjhs d</span></a></br>

答案 1 :(得分:1)

在您的媒体资源中对其进行编辑:

BigQuery bq = BigQueryOptions.getDefaultInstance().getService();
TableId tableId = TableId.of(datasetName, tableName);
InsertAllRequest.Builder insertReqBuilder = InsertAllRequest.newBuilder(tableId);
insertReqBuilder.addRow({some string}, row);
InsertAllResponse response = bigquery.insertAll(insertReqBuilder.build());

更新的密码笔链接:https://codepen.io/anon/pen/pxzdBP