Using CSS Target to highlight parent div

后端 未结 2 873
别那么骄傲
别那么骄傲 2021-01-28 11:14

I\'m using Ckeditor in my site to insert articles. The articles usually come from a Word document, and they have footnotes. With the last Ckeditor build (7125) I\'ve been able t

2条回答
  •  广开言路
    2021-01-28 11:46

    Unfortunately, there is no parent or ancestor types of selectors in CSS, for the reason that it is a major problem for browser performance. However, you can achieve what you want easily with JQuery:

    $("a:target").parent().css("background", "yellow");
    

提交回复
热议问题