Forums

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

Home Forums CSS input:focus…

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #41873
    barkins
    Member

    Can someone tell me why this isn’t working… Thank you!

    input:focus .project-info li {
    border-left:4px solid #cc3300;
    background:#e8e8e8;
    }

    #120398
    barkins
    Member

    My apologies, I think I figured out my own problem while putting it together in codepen.

    Essentially, I wanted a way, when a user :focus on an input, for the li outside of it to change its color, but that isn’t possible, since it’s on the outside.

    Sounds like this is a job for jQuery.

    #120409
    Andy Howells
    Participant

    Yep, you can’t link to other elements that aren’t related. What you could potentially do is use the sibling or adjacent selectors if the elements are one after the other.

    #120411
    Andy Howells
    Participant
    #120412
    Andy Howells
    Participant

    Just created a JQuery solution for if the UL is outside of the realm of using CSS.

    http://codepen.io/andyunleashed/pen/hBKHi

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