从超链接图像中删除外部链接图标 [英] Remove external link icon from hyperlinked images

查看:110
本文介绍了从超链接图像中删除外部链接图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一种从超链接图像中删除外部链接图标的方法.我希望图标仅在文本链接之后显示.我发现了这个从图像中删除外部链接图标,但没有任何答案在那里.

I am trying to find a way to remove the external link icon from hyperlinked images. I want the icon to be appeared after the text links only. I found this Remove external link icon from image but don't any answer over there.

#myLink a[href^="//"]:after, 
#myLink a[href^="http://"]:after,
#myLink a[href^="https://"]:after {
    content: "\f35d";
    font-family: "Font Awesome"; 
    font-weight: 900;
    margin: 0 0 0 5px;
}

推荐答案

实际上,我有一种使用jquery和CSS的方法.我将解决方案发布在这里,以防万一,如果有人需要的话.我只是使用jquery在标签中添加了一个类,然后将display:none添加到psuedo元素(:after)中.见下文:

Actually, I got a way using jquery and CSS. I am posting my solution here just in case, if anyone needs it. I just added a class in tag using jquery and just add display:none to the psuedo element (:after). See below:

$('a').has('img').addClass('hyperlinkedimage');

.hyperlinkedimage { display: none; }

这篇关于从超链接图像中删除外部链接图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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