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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:02:59+00:00 2026-06-02T08:02:59+00:00

How do i go about selecting nav elements in CSS3? I want to be

  • 0

How do i go about selecting nav elements in CSS3?

I want to be able to make a nav element – when hovered – change to a color i want.

Such as

<nav>
    <a href="#mainpage">first</a>  // i want to make this word, when hovered, into #555
    <a href="#secondpage">second</a>  // i want to make this word, when hovered, into #444
    <a href="#thirdpage">third</a>  //i want to make this word, when hovered, into #643312
    <a href="#fourthpage">fourth</a>  //i want to make this word, when hovered, into #444
    <a href="#fifthpage">fifth</a>  // i want to make this word, when hovered, into #666
</nav> 

How do i actually go about doing that?

I am reading about the CSS3 selectors but i don’t see any solutions (well at least not yet), so i’d thought i’ll get a faster answer here on Stack Overflow. I’ll continue searching to see if i yield any results.

  • 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-02T08:03:00+00:00Added an answer on June 2, 2026 at 8:03 am

    Maybe you’re looking for when hovered: (not sure your question isn’t very descriptive)

    nav a:nth-child(1):hover
    {
        color: #555
    }
    nav a:nth-child(2):hover
    {
        color: #444
    }
    nav a:nth-child(3):hover
    {
        color: #643312
    }
    nav a:nth-child(4):hover
    {
        color: #444
    }
    nav a:nth-child(5):hover
    {
        color: #666
    }
    

    JsFiddle.net Example​

    UPDATE

    If you’re wondering how every N works:

    <style>
    nav a:nth-child(3n+0):hover {
      background-color: #f00;
    }
    nav a:nth-child(3n+1):hover {
      background-color: #0f0;
    }
    nav a:nth-child(3n+2):hover {
      background-color: #0f0;
    }
    <style>
    
    <nav>
     <a href="#mainpage">first</a> 
     <a href="#secondpage">second</a> 
     <a href="#thirdpage">third</a>  
     <a href="#fourthpage">fourth</a> 
     <a href="#fifthpage">fifth</a>  
     <a href="#sixthpage">sixth</a>  
    </nav> ​
    

    JsFiddle.net Example

    Elements (0, 3, 6, 9 etc) will be Green (#f00).

    Elements (1, 4, 7, 10 etc) will be Blue (#0f0).

    Elements (2, 5, 8, 11 etc) will be Red (#00f).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I go about selecting COUNT(*)s from multiple tables in MySQL? Such as:
This is related to my previous question about selecting visible elements . Now, here's
How do I go on about selecting elements which has the same attribute values
var playerClass = $(this).parent().attr('class') Question about only selecting a specific class from the dom.
About to create a form using Zend Form, all the form elements should have
my question is about selecting the best method to perform a job. i'll present
I have been reading on the different question talking about selecting unique nodes in
I read much about Core Data.. but what is an efficient way to make
I am confused about selecting two approaches. Scenario there are two tables Table 1
I have a basic question about selecting counts: If I have a table ContentTable

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.