Forums

  • # January 9, 2013 at 11:55 am

    [http://jsfiddle.net/6PvLj/1/](http://jsfiddle.net/6PvLj/1/ “http://jsfiddle.net/6PvLj/1/”)

    Above I setup a JS Fiddle to demonstrate my current code.

    The gray boxes represent .classlinks, the black boxes #link_wrap a.

    Each item has a .classlinks wrapped around it. As you will notice, each item except one (2) is unlinked.

    How would I apply the gray background to the **unlinked element only** wikthout using nth-child? This is being used in WordPress for pagination, so the links are generated by WordPress, so the unlinked element is not static.

    # January 9, 2013 at 12:39 pm

    Use the span.

    You’ll have to make sure the colours match though, by explicitly setting one. In the fiddle below I used blue.

    http://jsfiddle.net/veaJW/

    # January 9, 2013 at 1:04 pm

    Why not just give your middle span a different class and then target it with the CSS you want?

    Also your HTML is dodgy, you haven’t closed some of the spans.

    # January 9, 2013 at 7:41 pm

    I came up with this

    http://jsfiddle.net/YBtAY/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag