Answers for "apply css only to parent div"

CSS
1

css only select parent

.list > ul > li { ... }
/* The > operator selects only elements that are direct children of the element(s) before it. */
Posted by: Guest on May-02-2021
16

css parent selector

/* There is no such selector
   in 2008, the following was suggested */

a < img { 'border': none }

/* Which in theory, would set an an images 'a' parent
   border to none
   Of course, this does not exist

   Another suggestion... */

div:parent { 'border': none }

/* Pretty self explainatory, nevertheless it does not
   exist.

   You will have to use JavaScript/jQuery */

$('some-element').parent();
Posted by: Guest on March-19-2020
0

secltor for parent li css

//in css no way!
//but in java can use this:
$("a.active").parents('li').css("property", "value");
Posted by: Guest on November-18-2020

Browse Popular Code Answers by Language