首页 > 解决方案 > 如何修复没有样式的html工具提示?

问题描述

使用 html 工具提示并将样式应用于工具提示类,这些样式正在通过开发人员工具进行检查,但在页面中不可见。

我已经尝试在 w3schools 中运行我的代码并且它正在工作。尝试在 DevTools 中更改值,但在我的本地仍然相同。

<h4>
I am 
<input type=number>
years old 
<span class= "tooltip">Some Text</span>, my annual income old <br> 
is 
<input type=number> 
and I have saved <br> 
<input type=number class= "numbers"> 
<span class="sub">(pre-tax or tax-exempt)</span>
and 
<input type=number> <span>(taxed).</span>
</h4>

应用的样式是:

.tooltip {
    position: relative !important;
    border: 2px solid black !important;
    height: 100px;
    background: red !important;
    width: 100px;
}

这就是我得到的。背景颜色和边框是不可见的,但它在源代码中。

结果

标签: htmlcsstooltip

解决方案


问题已解决,将类 Tootip 更改为其他名称,因为我的样式被环境中先前编写的样式覆盖。


推荐阅读