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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:35:38+00:00 2026-06-13T12:35:38+00:00

I would like to use pure css3 effects without using jQuery and I would

  • 0

I would like to use pure css3 effects without using jQuery and I would like to make the tab expand smoothly using css3 transition, but there is a problem.

If you look at the jsfiddle file you will notice a problem with the overlapping and crashing of tabs .

This is my HTML code:

<div id="wrapper">
    <nav id="mainnav">
        <ol>
            <li class="home"><a href="http://www.domain.com"></a></li>
            <li class="news"><a href="http://www.domain.com/p/">News</a></li>
            <li class="photos"><a href="http://www.domain.com/channels/s/">Photos</a> </li>
            <li class="biography"><a href="http://www.domain.com/e/">Biography</a></li>
        </ol>
    </nav>
</div>

and the CSS code:

div#wrapper{
width:990px;
height:auto;
margin:0 auto;

font:15px Arial,Verdana,Helvetica,sans-serif;

}
div#wrapper #mainnav{
width:100%;
height:40px;

border-bottom:1px solid #c4c4c4;
float:left;
clear:both;
background-color: #5b5b5b;
background-image: -moz-linear-gradient(#5b5b5b,#4d4d4d,#3f3f3f); 
background-image: -webkit-linear-gradient(#5b5b5b,#4d4d4d,#3f3f3f); 
background-image: -o-linear-gradient(#5b5b5b,#4d4d4d,#3f3f3f);
background-image: -ms-linear-gradient(#5b5b5b,#4d4d4d,#3f3f3f);
background-image: linear-gradient(#5b5b5b,#4d4d4d,#3f3f3f);
}

div#wrapper #mainnav ol{
list-style:none;
margin:0px; padding:0;
}
div#wrapper #mainnav li{
float:left;
}

div#wrapper #mainnav li.home{
background: #6db3f2; /* Old browsers */
background: -moz-linear-gradient(top,  #6db3f2 0%, #54a3ee 40%, #3690f0 56%, #1e69de 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6db3f2),  color-stop(40%,#54a3ee), color-stop(56%,#3690f0), color-stop(100%,#1e69de)); /*  Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* IE10+ */
background: linear-gradient(to bottom,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%);    /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6db3f2', endColorstr='#1e69de',GradientType=0 ); /* IE6-9 */

float:left;
width:48px;
height:40px;
position:relative;
margin-top:0px ; padding:0;
}
div#wrapper #mainnav li.home a{
background:url(home.png) 0px 0px no-repeat; 
margin-left:0px;
}


div#wrapper #mainnav li.home:hover{
background: #6db3f2; /* Old browsers */
background: -moz-linear-gradient(top,  #6db3f2 0%, #54a3ee 40%, #3690f0 56%, #1e69de 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6db3f2), color-stop(40%,#54a3ee), color-stop(56%,#3690f0), color-stop(100%,#1e69de)); /*  Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* IE10+ */
background: linear-gradient(to bottom,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6db3f2', endColorstr='#1e69de',GradientType=0 ); /* IE6-9 */
float:left;
width:48px;
height:40px;
position:relative;
margin-top:0px ; padding:0;
}
div#wrapper #mainnav li.home a:hover{
background:url(home.png) 0px 0px no-repeat; 
margin-left:0px;

}

div#wrapper #mainnav li.news:hover{
cursor:pointer;
border:1px solid #b30808; background-color: #e40a0a;
 background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e40a0a), color-stop(100%, #9f0202));
 background-image: -webkit-linear-gradient(top, #e40a0a, #9f0202);
background-image: -moz-linear-gradient(top, #e40a0a, #9f0202);
background-image: -ms-linear-gradient(top, #e40a0a, #9f0202);
background-image: -o-linear-gradient(top, #e40a0a, #9f0202);
background-image: linear-gradient(top, #e40a0a, #9f0202);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#e40a0a, endColorstr=#9f0202); 
 }
 div#wrapper #mainnav li.news a:hover{
background:url(awatch_icon.png) 5px 6px no-repeat; 
padding-top:9px;
text-shadow:1px 1px 1px blue;border-left:1px solid #000;
}

div#wrapper #mainnav li.photos:hover{
background: #6db3f2; /* Old browsers */
background: -moz-linear-gradient(top,  #6db3f2 0%, #54a3ee 40%, #3690f0 56%, #1e69de 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6db3f2), color- stop(40%,#54a3ee), color-stop(56%,#3690f0), color-stop(100%,#1e69de)); /* Chrome,Safari4+  */
background: -webkit-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* IE10+ */
background: linear-gradient(to bottom,  #6db3f2 0%,#54a3ee 40%,#3690f0 56%,#1e69de 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6db3f2', endColorstr='#1e69de',GradientType=0 ); /* IE6-9 */
}
div#wrapper #mainnav li.photos a:hover{
background:url(domain_icon.png) 5px 6px no-repeat;padding-top:10px;text-shadow:1px 1px 1px blue;}




div#wrapper #mainnav li.biography:hover{
background-color: #ffaf46;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffaf46), color-stop(100%, #e78404));
background-image: -webkit-linear-gradient(top, #ffaf46, #e78404);
background-image: -moz-linear-gradient(top, #ffaf46, #e78404);
background-image: -ms-linear-gradient(top, #ffaf46, #e78404);
background-image: -o-linear-gradient(top, #ffaf46, #e78404);
background-image: linear-gradient(top, #ffaf46, #e78404);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ffaf46, endColorstr=#e78404);
}
div#wrapper #mainnav li.biography a:hover{
 background:url(icon.png) 5px 6px no-repeat;padding-top:10px;text-shadow:1px 1px 1px blue;}



div#wrapper #mainnav li{background:url(mainnav_sep.jpg) no-repeat left top;float:left;}
div#wrapper #mainnav li a{display:block;padding-top:11px;color:#fff;margin:0  10px;cursor:pointer;height:27px;text-shadow:1px 1px 1px #000;}
div#wrapper #mainnav li a:link, div#wrapper #mainnav li a:visited{text-decoration:none;}
div#wrapper #mainnav li a:hover,div#wrapper #mainnav li a:active, div#wrapper #mainnav li a:focus {
transition:width 2s;
-moz-transition:width 2s; /* Firefox 4 */
-webkit-transition:width 2s; /* Safari and Chrome */
-o-transition:width 2s; /* Opera */
width:120px;height:29px;margin:0px 0px 0px 0px ;text-indent:35px;text- decoration:none;color:#fff;text-shadow:1px 1px 1px #000;}
  • 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-13T12:35:39+00:00Added an answer on June 13, 2026 at 12:35 pm

    It is because you are giving transition effect to <a> element, try giving it to <li> element and change the widths…

    Simply try something like this

    HTML

    <ul>
        <li>blah</li>
        <li>blah2</li>
    </ul>​
    

    CSS

    ul li:nth-child(1){
        background-color: #ff0000;
    }
    
    ul li:nth-child(2){
        background-color: #00ff00;
    }
    
    li {
        display: inline-block;
        height: 20px;
        width: 100px;
        text-align: center;
         transition:width 2s;
        -moz-transition:width 2s; /* Firefox 4 */
        -webkit-transition:width 2s; /* Safari and Chrome */
        -o-transition:width 2s; /* Opera */
    }
    
    li:hover {
         width: 300px;
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use the jQuery button elements as standalone - without the
I would like to use the logout function from Django but not sure how
I would like to use D3.js (or maybe Raphaël ) for backend-generated reports using
I would like to use the MFMailComposeViewController mailComposeDelegate property with completion block syntax, but
I would like to use the following class across multiple modules without needing log
I know you can use pHash from .NET or Java, but I would like
I know it doesn't exist, but is there a pure CSS version? Would like
I have an idea for a layout I would like to use, but I
I would like to use a pure ruby database (kirbybase http://www.netpromi.com/files/kirbybase_ruby_manual.html ) together with
I have an array of Integers in Java, I would like use only a

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.