I have a HtmlAction Link with a tool tip displayed on mouse hover. Following is the code.
<td> @Html.ActionLink(@item.Split('.')[0], "Usecase", new { name = item }, new {Class = "action add", title = "MyToolTip" })</td>
Now I want to add CSS to my Tooltip.How is CSS added to my tool tip?
Thanks in advance!!
答案 0 :(得分:0)
You can add CSS by calling on the class action
or add
. Both of those are declared as classes for this tooltip in the code you supplied.
For example.
.action {
/*Your styles in here*/
}
答案 1 :(得分:0)
You will have to implement your own tooltip. Please check the example given here https://www.w3schools.com/css/tryit.asp?filename=trycss_tooltip. Create a span containing your tooltip text with visibility hidden. Then on hover of your anchor, set its visibility to visible.
.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;
}
<p>Move the mouse over the text below:</p>
<div class="tooltip">Hover over me
<span class="tooltiptext">Tooltip text</span>
</div>
<p>Note that the position of the tooltip text isn't very good. Go back to the tutorial and continue reading on how to position the tooltip in a desirable way.</p>