Как оформить подсказку в Html ActionLink - PullRequest
0 голосов
/ 19 декабря 2018

У меня есть ссылка HtmlAction с подсказкой, отображаемой при наведении курсора мыши.Ниже приведен код.

<td> @Html.ActionLink(@item.Split('.')[0], "Usecase", new { name = item }, new {Class = "action add", title = "MyToolTip" })</td>

Теперь я хочу добавить CSS в мою подсказку. Как CSS добавляется в подсказку?

Заранее спасибо !!

Ответы [ 2 ]

0 голосов
/ 19 декабря 2018

Вам нужно будет реализовать собственную подсказку.Пожалуйста, проверьте пример, приведенный здесь https://www.w3schools.com/css/tryit.asp?filename=trycss_tooltip. Создайте диапазон, содержащий текст всплывающей подсказки со скрытой видимостью.Затем при наведении курсора установите его видимость на видимый.

.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>
0 голосов
/ 19 декабря 2018

Вы можете добавить CSS, вызвав класс action или add.Оба они объявлены как классы для этой подсказки в предоставленном вами коде.

Например.

.action {
   /*Your styles in here*/
}
...