Possible Duplicate:
CSS previous sibling selector
How to select the above element of an element in CSS using selectors
<li class="content">One</li>
<li class="content">Two</li>
<li class="content">Three</li>
<li class="no-content">First</li>
<li class="content">Four</li>
<li class="content">Five</li>
<li class="content">Six</li>
Here I want to use the class no-content
, so that I can get its above element <li class="content">Three</li>
, using CSS selector.
<li>
before <li class="no-content">
is “preceding sibling” - Paul D. Waite 2012-04-04 07:20
This is not possible with pure CSS...
Are you looking the same:- http://jsfiddle.net/rohitazad/4Y9D5/3/
you can select to bottom div but not select to top .
test
there, its only for you to understand what I need. Is it possible to select the test class node to be selected with the class no-content
.. - Justin John 2012-04-04 08:01
$('li.no-content').prev().addClass('prev')
powerbuoy 2012-04-04 06:58