Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Does a CSS Solution Exist for Unlinked Elements?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41875
    siouxfan45
    Participant

    [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.

    #120407
    Andy Howells
    Participant

    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/

    #120415
    Andy Howells
    Participant

    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.

    #120429
    hotpink
    Member

    I came up with this

    http://jsfiddle.net/YBtAY/

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.