Remove line under image in link

前端 未结 8 920
北恋
北恋 2020-12-17 15:10

I have a few instances where I place image within a link. Normally if you set border=\"0\" there line under a link does not apply to the image. However, I had to specify DOC

相关标签:
8条回答
  • 2020-12-17 15:37

    A solution would be to use the image as a background image instead of in the html, possibly the background of the parent element of the a.

    0 讨论(0)
  • 2020-12-17 15:40

    My two cents:

    $('a').each(function(){
        var images = $(this).find("img");
        images.parent().addClass('no_border_img');
    });
    

    Loop all links and find images inside, then for each one add CSS style to the link.

    Only for a image with link inside a previous link style. Remember to create the style for 'no_border_image'.

    0 讨论(0)
提交回复
热议问题