简体   繁体   English

Rails:为 link_to 显示红色工具提示

[英]Rails: display tooltip with red color for link_to

I want to create a tooltip with red colour font for link_to in rails.我想为 rails 中的 link_to 创建一个带有红色字体的工具提示。 Ex: The below code i used for link_to例如:我用于link_to的以下代码

<%= link_to "javascript:void(0)", 'data-toggle': 'tooltip', title:"Click to delete \n <span style='color:red;'>Warning:- You will not be able to use </span>",onclick: "delete",style: "color:blue;",class: "custom_tooltp" %>

Issue : I'm not getting warning text in red colour.问题:我没有收到红色警告文本。

Thanks in advance.提前致谢。

To create a red link in HTML:在 HTML 中创建红色链接:

<a href="https://blog.corsego.com/" style="color:#FF0000;">Red Link</a>

With a ruby link_to:使用 ruby​​ link_to:

= link_to "Blog", "https://blog.corsego.com", target: :_blank, style: "color:#FF0000;"

Post some research i found solution and worked for me.发布一些研究,我找到了解决方案并为我工作。

css : .red-tooltip + .tooltip > .tooltip-inner {background-color: #ffffff; css : .red-tooltip + .tooltip > .tooltip-inner {background-color: #ffffff; color:#000000;} js : $('[data-toggle="tooltip"]').tooltip();颜色:#000000;} js:$('[data-toggle="tooltip"]').tooltip();

<%= link_to "javascript:void(0)", 'data-toggle': 'tooltip','data-html': 'true', 'data-placement': 'left', title:"Click to delete <%= link_to "javascript:void(0)", 'data-toggle': 'tooltip','data-html': 'true', 'data-placement': 'left', title:"点击删除
Warning:- You will not be able to use ",onclick: "delete",style: "color:blue;",class: "red-tooltip" %>警告:- 您将无法使用 ",onclick: "delete",style: "color:blue;",class: "red-tooltip" %>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM