Remove line under image in link

前端 未结 8 981
北恋
北恋 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条回答
  •  旧时难觅i
    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'.

提交回复
热议问题