是否可能在{content:" ..."}中有超链接? [英] Is it possible to have a hyperlink inside {content:"..."}?

查看:147
本文介绍了是否可能在{content:" ..."}中有超链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

META: 此文档被标记为重复,我建议创建另一个帖子,这是我在这里做的:如何获取超链接弹出关于鼠标悬停的术语参考,并且将HTML项与弹出项相分离。参考内容

作为一个反思:我认为它可以更好地表达应用的目标。尤其是对于未经经验的用户,难以选择在1手上的特异性和在另一方面的目标取向之间的良好折衷。我的道歉为任何麻烦。非常感谢您的帮助。

里面的CSS语法 {content:...}

例如,以下是我创建的一段代码,有鼠标悬停时的字词说明:

As an example, here is a piece of code I created, to have a term decription on mouse-hover:

< br& < term id =HPV> HPV< / term>

term{text-decoration:underline; text-decoration-style:dotted; -moz-text-decoration-style:dotted}

term:hover{text-decoration:none; color:#aaaaaa}

term#HPV:hover:after{position:relative; padding: 1px; top:-0.9em; left:-5px; border:1px dotted #aaaaaa; color:black}

term#HPV:hover:after{content:"Human papillomavirus."}






我想知道如何获得人乳头瘤病毒。 超链接

推荐答案

css没有解决方案。任何内容内容都不会是html标记,它只有文本。所以你可以在hover上添加一个html元素,链接到另一个url。例如 http://jsfiddle.net/naeemshaikh27/1ysyr0tb/2/

There is no solution for this with css. anything inside content will not be html markup, its only text. so you could probably add an html element on hover which links to another url. for example http://jsfiddle.net/naeemshaikh27/1ysyr0tb/2/

$(function(){
    $('#HPV').hover(function(e){
       $(this).append('<a href="google.com">click me</a>');;
    },function(){

    });
});

这篇关于是否可能在{content:&quot; ...&quot;}中有超链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆