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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:54:41+00:00 2026-06-08T02:54:41+00:00

I want to do a menu for my website like this with the transition

  • 0

I want to do a menu for my website like this with the transition in each section. I want the red bar move along I click on other sections.

http://piccsy.com/investors/

What is the best way to do that?

I have also tried to do it myself but it doesn’t work.

http://alpha.venasanxenxo.com/piccsy

  • 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-08T02:54:42+00:00Added an answer on June 8, 2026 at 2:54 am

    Do you want to achieve the same effect using just CSS3? That menu uses JavaScript. There is no CSS way (yet… it should come with CSS4) to change the CSS of an element by clicking an element that isn’t its sibling or it’s parent.

    It is possible, however, to achieve the same effect for the bar (for smooth scrolling you need to use JavaScript). But not with that HTML structure.

    I’ve tried a couple of things:

    1. This http://dabblet.com/gist/3155730 does it with links, but whenever you click elsewhere on the page (not on the links) the effect disappears.

    The idea in this case is to have a gradient on that element below and to change its size when clicking the links. Do note that the HTML is different, so that the element below can be a sibling of the links.

    <div class="ui-menu">
        <a class="goto-frame" href="#" tabindex="1">Welcome
            </a><a class="goto-frame" href="#" tabindex="1">Problem
            </a><a class="goto-frame" href="#solution" tabindex="1">Solution
            </a><a class="goto-frame" href="#team" tabindex="1">Team
            </a><a class="goto-frame" href="#traction" tabindex="1">Traction
        </a><a class="goto-frame" href="#product" tabindex="1">Product
            </a><a class="goto-frame" href="#contact" tabindex="1">Contact</a>
        <div class="ui-menu-bottom-line"></div>
    </div>
    

    The formatting of the HTML does serve a purpose: I’ve made the links inline-block so I cannot have any kind of white space between the closing tag </a> and the next opening tag <a class="goto-frame">.

    The CSS:

    .ui-menu {
        width: 37em;
        padding: 0;
        text-align: center;
    }
    .ui-menu a {
        width: 4em;
        margin: 0;
        padding: .1em .5em;
        display: inline-block;
        font: 17px "Arial Narrow", sans-serif;
        text-align: center;
        text-decoration: none;
    }
    .ui-menu a:focus {
        outline: none;
    }
    .ui-menu-bottom-line {
        width: 35em;
        height: 1px;
        margin: 1em auto;
        background: #d7d7d7
            linear-gradient(left, #d82126 50%, transparent 50%) no-repeat;
        background-size: 5em;
        transition: 1s; 
    }
    .ui-menu a:nth-child(2):focus ~ .ui-menu-bottom-line,
    .ui-menu a:nth-child(2):active ~ .ui-menu-bottom-line {
        background-size: 15em;
    }
    .ui-menu a:nth-child(3):focus ~ .ui-menu-bottom-line,
    .ui-menu a:nth-child(3):active ~ .ui-menu-bottom-line {
        background-size: 25em;
    }
    /* and so on, I keep adding 10em with every new menu item */
    

    Works in Chrome, Firefox, Safari, Opera, IE10 as gradients don’t work in IE9 and older (and neither do transitions).

    Could be made to work in IE9 and 8 and older by using a pseudo-element on .ui-menu-bottom-line, setting its background dark red and then changing its width on click (instead of changing the background gradient size).


    2. This http://dabblet.com/gist/3155740 works as required even after releasing the mouse button, but it does not use links.

    HTML

    <div class="ui-menu">
        <input type="radio" name="mi" id="welcome">
        <label class="goto-frame" for="welcome">Welcome</label>
        <input type="radio" name="mi" id="problem">
        <label class="goto-frame" for="problem">Problem</label>
        <input type="radio" name="mi" id="solution">
        <label class="goto-frame" for="solution">Solution</label>
        <input type="radio" name="mi" id="team">
        <label class="goto-frame" for="team">Team</label>
        <input type="radio" name="mi" id="traction">
        <label class="goto-frame" for="traction">Traction</label>
        <input type="radio" name="mi" id="product">
        <label class="goto-frame" for="product">Product</label>
        <input type="radio" name="mi" id="contact">
        <label class="goto-frame" for="contact">Contact</label>
        <div class="ui-menu-bottom-line"></div>
    </div>
    

    CSS – same idea, only this time I’m not clicking links – I’m checking radio buttons instead

    .ui-menu {
        width: 37em;
        padding: 0;
        font: 17px "Arial Narrow", sans-serif;
        text-align: center;
    }
    .ui-menu input[type=radio] { display: none; }
    .ui-menu label {
        width: 4em;
        margin: 0;
        padding: .1em .5em;
        display: inline-block;
        text-align: center;
    }
    .ui-menu-bottom-line {
        width: 35em;
        height: 1px;
        margin: 1em auto;
        background: #d7d7d7
            linear-gradient(left, #d82126 50%, transparent 50%) no-repeat;
        background-size: 5em;
        transition: 1s;
    }
    .ui-menu #welcome:checked ~ .ui-menu-bottom-line {
        background-size: 5em;
    }
    .ui-menu #problem:checked ~ .ui-menu-bottom-line {
        background-size: 15em;
    }
    /* and so on, add 10em to the bg size for each new menu item */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a similar navigation menu like what m.facebook.com did. but this,
i am making a website in php i make left menu like this these
I'd like to add a fade-in/fade-out effect to the menu on this website .
I want to make a simple fish eye menu for my website like on
I want to make a menu where each item is separated with a ·.
I would like to know if this is possible in java that i want
I would like to have sections of a site so the top menu is
I am writing some css code for a school website that looks like this
I'm working on a website for a small law office. There's a menu bar
I got a problem like this (this is html/css menu): Eshop | Another eshop

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.