Hi,
I need to override the defined :last-child style defined in my stylesheet using jQuery. I'm aiming for minimal markup using a combination of css and jQuery where the structure around "container-content" is appended to the div on document-ready.
<div id="title-some-impact"><!--Vertical container title--></div>
<div class="container-content-wrapper">
<div></div>
<div class="container-content"><!--Actual container content-->
<div class="sub-container-content"></div>
</div>
<div style=""></div>
</div>
<div style="clear: both;"></div>
</div>
I'm using the first and last div in container-content-wrapper to add rounded corners using css, like so:
.container-content-wrapper>div:first-child { /* rounded corners top */
width: 930px;
height: 16px;
background: url(../Images/top-rounded-corners.png) top no-repeat;
}
.container-content-wrapper>div:last-child { /* rounded corners bottom */
width: 930px;
height: 33px;
background: url(../Images/bottom-rounded-corners.png) top no-repeat;
}
In some cases I need to change the bottom background image using jQuery / JavaScript have failed miserably so far.
I've tried using: $('.container-content-wrapper>div:first-child').css('background', 'some other link'); Also, adding another class that points to another image does not work.
How can I override the defined :last-child style defined in the stylesheet using jQuery?