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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:01:11+00:00 2026-06-11T09:01:11+00:00

Roll over the text and the blue block below moves along the blue line.

  • 0

Menu

Roll over the text and the blue block below moves along the blue line. If I do it via position relative and set the blue block to top 20px, it also moves the text down.

Is there a way I can do this purely in CSS, or should I use a background image with the top half set as a transparent gif and the bottom blue?

The code I’ve tried so far is:

#menu ul {
    list-style:none;
    margin:0;
    padding:10px;
    text-align:center;
}
#menu ul li {
    display:block;
    float:left;
    list-style:none;
    margin-right: 40px;
    font-family: Arial, Helvetica, sans-serif;
    color: #FFF;
    font-size: 14px;
    padding-top: 5px;
    padding-bottom: 5px;
    height: 39px;
}
#menu ul li a {
    display:block;
    margin:0px;
    padding:0px;
    color:#FFF;
    text-decoration:none;
    font-family: Arial, Helvetica, sans-serif;
    margin-right: 5px;
    margin-left: 5px;
    padding-left: 10px;
    padding-right: 10px;
}
#menu ul li a:hover {
    color:#fff;
    margin-bottom:5px;
    padding-bottom:5px;
}
#menu ul li a.active,
#menu ul li a.active:hover {
    color:#fff;
    background-color: #0488C5;
    font-weight:bold;
}

I am still learning so excuse any mistakes!

  • 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-11T09:01:12+00:00Added an answer on June 11, 2026 at 9:01 am

    Click here for a demo.

    ​<ul>
        <li><a href="#" class="active">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Products</a></li>
    </ul>
    
    ul {
        width: 100%;
        border-bottom: 3px solid blue;
        overflow: hidden;
    }
    
    li {
        float: left;  
        margin: 0 20px 0 20px;                
    }
    
    li a {
        border-bottom: 20px solid #fff;
        display: block;
    }
    
    li a:hover, .active {
        border-bottom: 20px solid blue;
    }
    

    ​You can then use the hover state for another class called something like “active” that you can apply when on that page.

    You should be able to tweak this example to suit your needs.

    You don’t need any images. CSS is more than capable of doing this for you.

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

Sidebar

Related Questions

You know when you use the CSS background-position property for rollovers, right? Roll over
Trying to make it so my text appears when I roll over the image:
I'm trying to make an image appear when you roll over text on the
i have some javascript roll over code that works fine in firefox but when
I am using CSS Image sprites for roll over effect on a element, the
I am trying to change a text fields text when I am rolling over
So I have this Div that has a roll over effect on it where
I am using TinyMCE text editor and the text within the does not roll
I have a series of text links, which when rolled over, would cause a
I have a text-rollover where an address-block appears on rollover. The address-block itself has

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.