【问题标题】:Add tooltip in button control orderlist Primeng在按钮控件订单列表中添加工具提示 Primeng
【发布时间】:2021-07-12 21:18:19
【问题描述】:

我尝试在控件按钮顺序列表中添加工具提示

我的组件

Component({
  selector: 'app-block',
  templateUrl: './block.component.html',
  styleUrls: ['./block.component.css'],
  styles:[`
    button[icon="pi pi-angle-double-up"] {
      /* what should I write here */
    }
  `],
  encapsulation: ViewEncapsulation.None
})

那么有没有其他方法可以向我想要的按钮添加工具提示,或者使用 css 执行此操作的正确方法是什么?

【问题讨论】:

    标签: javascript css angular tooltip primeng


    【解决方案1】:

    你需要像这样自定义你的 block.component.html 和 block.component.css :

    .tooltip {
      position: relative;
      display: inline-block;
      border-bottom: 1px dotted black;
    }
    
    .tooltip .tooltiptext {
      visibility: hidden;
      width: 120px;
      background-color: black;
      color: #fff;
      text-align: center;
      border-radius: 6px;
      padding: 5px 0;
      /* Position the tooltip */
      position: absolute;
      z-index: 1;
    }
    
    .tooltip:hover .tooltiptext {
      visibility: visible;
    }
    <html>
    
    <body style="text-align:center;">
    
      <p>Move the mouse over the text below:</p>
    
      <div class="tooltip">Hover over me
        <span class="tooltiptext">Tooltip text</span>
      </div>
    
    </body>
    
    </html>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-28
      • 1970-01-01
      • 1970-01-01
      • 2021-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多