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 8372087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:19:47+00:00 2026-06-09T14:19:47+00:00

I have a simple jquery vertical accordion and would like to have different font

  • 0

I have a simple jquery vertical accordion and would like to have different font sizes, colours and weights for top and sub-menu level links. I’m not having much luck achieving this with changing the CSS. What am i missing? Is there a simple way to do it:

html code:

<script type="text/javascript">
 $(document).ready(function () {
    $('#nav > li > a').click(function(){
       if ($(this).attr('class') != 'active'){
          $('#nav li ul').slideUp();
          $(this).next().slideToggle();
          $('#nav li a').removeClass('active');
          $(this).addClass('active');
       }
    });
 });
</script>
<style type="text/css"></style>
</head>
<body>
  <ul id="nav">
    <li><a href="#">Item 1</a>
      <ul>
        <li><a href="#">Sub-Item 1 a</a></li>
        <li><a href="#">Sub-Item 1 b</a></li>
        <li><a href="#">Sub-Item 1 c</a></li>
      </ul>
    </li>
    <li><a href="#">Item 2</a>
      <ul>
        <li><a href="#">Sub-Item 2 a</a></li>
        <li><a href="#">Sub-Item 2 b</a></li>
      </ul>
    </li>
    <li><a href="#">Item 3</a>
      <ul>
        <li><a href="#">Sub-Item 3 a</a></li>
         <li><a href="#">Sub-Item 3 b</a></li>
        <li><a href="#">Sub-Item 3 c</a></li>
        <li><a href="#">Sub-Item 3 d</a></li>
      </ul>
    </li>
    <li><a href="#">Item 4</a>
      <ul>
        <li><a href="#">Sub-Item 4 a</a></li>
        <li><a href="#">Sub-Item 4 b</a></li>
        <li><a href="#">Sub-Item 4 c</a></li>
      </ul>
    </li>
  </ul>
</body>

and here is my CSS code:

}
#nav {
float: left;
width: 155px;
border-top: 1px solid #999;
border-right: 1px solid #999;
border-left: 1px solid #999;
}
#nav li a {
display: block;
background: #ccc;
border-top: 1px solid #eee;
border-bottom: 1px solid #999;
text-decoration: none;
color: #000;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
padding-top: 2px;
padding-right: 3px;
padding-bottom: 4px;
padding-left: 3px;
}
#nav li a:hover, #nav li a.active {
background: #999;
color: #fff;

}
#nav li ul {
display: none; // used to hide sub-menus
}
#nav li ul li a {
background: #ececec;
border-bottom: 1px dotted #ccc;
padding-top: 2px;
padding-right: 3px;
padding-bottom: 4px;
padding-left: 3px;

}

Any enlightening on this would be much appreciated!

  • 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-09T14:19:50+00:00Added an answer on June 9, 2026 at 2:19 pm

    This should target the submenus:

    ul#nav li ul li {
        /* some css here to change font etc */
    }
    

    Or to target the ‘a’ tags within the submenus:

    ul#nav li ul li a {
        /* some css here to change font etc */
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Jquery but have written a simple vertical accordion. It seems
I have a simple JQuery enabled ASP.NET page: <script> $(document).ready(function() { $(#accordion).accordion(); }); </script>
I have a simple jQuery function: $('#selectable1 span').live('mousedown', function() { var ff = $(this).css(font-family);
I have a simple accordion setup, with just two sections. The top, first section
I want to use jQuery to animate a simple vertical menu that can be
Let's assume that we have simple jQuery code like the following: var $document =
I have some simple jQuery toggle script like this: <script type=text/javascript> $(document).ready(function() { $('#clickedit').click(function()
I have a simple jQuery script to show/hide list elements accordion-style along with a
I have some simple JQuery / Javascript to perform some simple logic for all
I have a simple jQuery script that I'm trying to build upon but I

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.