• # January 9, 2013 at 11:55 am

    []( “”)

    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.

    # January 9, 2013 at 12:54 pm

    This reply has been reported for inappropriate content.

    That didn’t do it. I was looking to apply the grey background to the unlinked element (2) only. This simply made everything one color.

    # 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 1:15 pm

    This reply has been reported for inappropriate content.

    Fixed. Because this is for WP_LINK_PAGES and adding a different class to the middle span would require a custom function. As i said, the links are generated in WP.

    # January 9, 2013 at 7:41 pm

    I came up with this

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

You must be logged in to reply to this topic.