Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8573525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:16:16+00:00 2026-06-11T19:16:16+00:00

I have the following css which needs to alter the last-child which does not

  • 0

I have the following css which needs to alter the last-child which does not have the class “myClass” but I can’t seem to get it to work.

Any ideas where I’m going wrong?

ul li:not(.myClass):last-child a {
    font-style:italic;
}

Example html as requested:

<ul>
    <li><a href="#">one</a></li>
    <li><a href="#">two</a></li>
    <li><a href="#">three</a></li>
    <li class="myClass"><a href="#">Extra</a></li>
</ul>

I want to apply the css to li three…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:16:17+00:00Added an answer on June 11, 2026 at 7:16 pm

    this can’t be done with css only if you are capable to use jQuery you might find this solution helpful.

    http://jsfiddle.net/6ku3Y/

    $('ul li').not('.myClass').last().find('a').addClass('mystyle');​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following CSS: table tbody tr:last-child td { padding-top: 7px; border-bottom: 0; }
I currently have the following CSS for my 4 columns which might grow to
I have an element, which has the following CSS: .elem { left: 0; position:
I have a <div id=outer> which has the following css: position:relative; width:300px; height:125px; float:left;
I have the following css: .btn_container { cursor: pointer; font-family: Tahoma,Verdana,Arial; font-size: 11px; padding:
I have the following css file: /*! * http://meyerweb.com/eric/tools/css/reset/ * v2.0 | 20110126 *
I have the following css code h1, h2, h3, h4 { color: #333; font-size:
I have the following CSS on my HTML page: <style type=text/css> .hidden {display:none;} .visible
I have the following CSS code being used for centering an <img> tag .img
I have the following CSS in my header: <style type=text/css> table, td { border-color:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.