How to select Parent Div in CSS [duplicate]


Tags: css,css3

Problem :

This question already has an answer here:

I am trying to select a parent div in google earth which it doesnt have any id or class and it it is just a div element. I used this method

div < div.well {background-color: red !important; }

since the div contains another div with the class of .well but this seems not working! can you please let me know what i am doing wrong?

Thanks

Update

Please Look at This Jsfiidle



Solution :

I dont know the context here, but if you can't modify the html, this is possible with jQuery as follows:

<script>
jQuery('div.well').parent('div').css('background', 'red');
</script>

As others have noted, there is no CSS solution.


    CSS Howto..

    How to make 1 css value dependent on another?

    how i can make slideshow, get information(image, title , content) from database? [closed]

    How can I use CSS pseudo-classes with GWT's UiBinder?

    Show first image and display none other image

    How to align a label to the “BOTTOM” of a div in CSS?

    How to highlight table row on hover using CSS only?

    How to save css style after hover action

    How to fix an image to the bottom right with resizing window?

    How to create donut chart in pure css & svg

    How to split the image using Javascript + CSS?

    Using CSS, how to create a two-column grid with equal-width columns that are “only as narrow as required”?

    In a 3 column grid of a varying number of elements, how to select only the elements that appear on the last line using CSS

    How to make a div fill up remaining horizontal space

    How to make text appear under div without moving other items in list?

    In firebug, how do I find out all of the css styles being applied to a particular element?

    fa-star () is always yellow, how to make it white?

    How to use CSS to show rotated text in a table cell

    how to turn off the break word in css? [duplicate]

    Fixing GoogleMonkeyR column width issue. How to change a script's CSS?

    How to add css to 1 element when hiding another?.. Jquery

    How to stack an overlay over html5 video

    how to access the styles from CSS

    I have a CSS file in my App_Themes folder - how can I apply it to my web user control?

    ExtJS - How to customize buttons?

    Images set within CSS and not showing in the HTML [closed]

    How to change text color of a link inside jQuery accordion

    How to Get Element From Path Not Class or Id

    sunken border when background-color css specified - how to avoid?

    How Do I Set the condition for a user to have to fill in a Textfield

    How to get css or java class for specific part of code