- This topic is empty.
-
AuthorPosts
-
August 4, 2014 at 9:13 am #177534
daleylife
ParticipantWant 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;}
August 4, 2014 at 9:17 am #177535Paulie_D
MemberCould you make a codepen.io demo…the code is a little hard to read.
August 5, 2014 at 1:41 am #177671daleylife
ParticipantThe 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>August 5, 2014 at 3:34 am #177681Paulie_D
MemberCould you make a codepen.io demo…the code is a little hard to read.
August 5, 2014 at 4:25 am #177683daleylife
ParticipantHow do you add a codepen demo?
August 5, 2014 at 4:27 am #177684Paulie_D
MemberWant to remove hover effect only on dropdown without classes!
You’re still not being very clear but is this it?
August 5, 2014 at 6:50 am #177693daleylife
ParticipantYes I want to change bottom border to transparent on item 2
August 5, 2014 at 7:00 am #177694Paulie_D
MemberYes I want to change bottom border to transparent on item 2
Just on Item 2?
August 5, 2014 at 1:26 pm #177805daleylife
ParticipantThanks, 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?August 5, 2014 at 1:49 pm #177809Paulie_D
MemberYou might find this useful
http://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize–net-16048
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.