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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:51:02+00:00 2026-06-14T04:51:02+00:00

I have 2 or more <UL> sets inside, and wants to only make first

  • 0

I have 2 or more <UL> sets inside, and wants to only make first UL <a> set to bold.
in fact, this is a menu with multiple sub menus, and I only want to make parent links bold.

I know it can be done by adding some more ID’s or classes, but this is not an option, and just want to try css method only.

<ul class="menu">
    <li class="collapsed first">
        <a title="Mechanical products" href="1">Mechanical Products</a>
    </li>
  <li class="collapsed">
    <a title="Chemicals" href="2">Chemicals</a>
  </li>
  <li class="expanded active-trail">
    <a title="Instrumentation" href="3">Instrumentation</a>
    <ul class="menu">
        <li class="leaf first">
            <a title="Control valves FISHER" href="4">Control Valves</a>
        </li>
      <li class="expanded active-trail">
        <a class="active" title="Corrosion Monitoring System" href="5">Corrosion Monitoring</a>
        <ul class="menu">
            <li class="leaf first">
                <a title="Access Fitting Assemblies" href="6">Fitting Assemblies</a>
            </li>
          <li class="leaf last">
            <a title="Coupon Holders, Coupons &amp; Probes" href="7">Holders,Coupons</a>
          </li>
        </ul>
      </li>
    </ul>
  </li>
    <li class="collapsed">
        <a title="Mechanical products2" href="8">Mechanical Products2</a>
    </li>
</ul>

as of this example, only “Mechanical Products”, “Chemicals”, “Instrumentation” and “Mechanical Products2” should get bold.

  • 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-14T04:51:04+00:00Added an answer on June 14, 2026 at 4:51 am

    Use the first child selector: >

    .menu > li {
        font-weight: bold;
    }
    

    Not that if you need to support IE6, you’ll have to do it manually, as IE6 doesn’t support the > selector:

    .menu li a {
        font-weight: bold;
    }
    .menu li ul li a {
        font-weight: normal;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a service that will return 0 or more sets of data. The
I have more than 100 million unique strings (VARCHAR(100) UNIQUE in MySQL database). Now
I have more than 400 000 id's in NOT IN statement. Whether it will
I have more than one Event Listener that calls a specific function, and I
I have more or less been able to understand and implement all these concepts
i have more viewcontroller that start from rootviewcontroller. So for example i start with
I have more than 5000 image links and I need to find a way
I have more than 3000 members on a site built using wordpress. I am
I have more than 30 images and and i am getting them in a
my application may have more then one users on the same phone, and 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.