Forums

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

Home Forums CSS [Solved] Trying to change bottom border li on dropdown ul

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #177534
    daleylife
    Participant

    Want to remove hover effect only on dropdown without classes!

    <li><a href=""><span>News</span></a><ul>
                <li><a href=""><span>latest</span></a></li>
                <li><a href=""><span>past</span></a></li>
                <li><a href=""><span>world</span></a></li>
                <li><a href=""><span>past world</span></a></li>
                <li><a href=""><span>funny</span></a></li>
              </ul>

    this is the specific css

    #primary-nav a span{
        border-bottom-style: solid;
        border-bottom-width: .2em;
        border-bottom-color: transparent;
        margin-bottom: .3em;
    }/*made up to h4 bottom margin*/
    #primary-nav span:hover {
        border-bottom-color: #CE0508;
    }
    #primary-nav span:hover span:first-child:nth-last-child(2) {
        border-bottom-color: transparent;
    }
    
    #primary-nav #current span:hover {
        border-bottom-color: transparent;
        cursor: default;}
    #177535
    Paulie_D
    Member

    Could you make a codepen.io demo…the code is a little hard to read.

    #177671
    daleylife
    Participant

    The id is on the ul. The rest of the code works and I can target the a, but not the span.
    This is the part I have trouble with.

    \#primary-nav span:hover span:first-child:nth-last-child(2) {
    border-bottom-color: transparent;
    }
    <code></code>

    #177681
    Paulie_D
    Member

    Could you make a codepen.io demo…the code is a little hard to read.

    #177683
    daleylife
    Participant

    How do you add a codepen demo?

    #177684
    Paulie_D
    Member

    Want to remove hover effect only on dropdown without classes!

    You’re still not being very clear but is this it?

    http://codepen.io/Paulie-D/pen/icKDl

    #177693
    daleylife
    Participant

    Yes I want to change bottom border to transparent on item 2

    #177694
    Paulie_D
    Member

    Yes I want to change bottom border to transparent on item 2

    Just on Item 2?

    http://codepen.io/Paulie-D/pen/elIuo

    #177805
    daleylife
    Participant

    Thanks, you are brilliant.
    Would you be so kind as to explain the selectors so I can understand the code?
    I would probably use classes added through php, but I wanted to know how to do it this way.
    How do you add codepen to posts?

    #177809
    Paulie_D
    Member
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.