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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:12:01+00:00 2026-06-07T21:12:01+00:00

The idea for the piece of css/jQuery I’m playing about with is that basically,

  • 0

The idea for the piece of css/jQuery I’m playing about with is that basically, one div of colour sits on top of another, then fades out with a link on the top so that the colour behind the main div shows through on mouseover and returns back to the main colour after you leave the div.

My issue is that basically I can’t fit the text into a division and have it constantly on top because if it’s placed in the fading div then the text obviously fades out, likewise it won’t always show up when it’s on the bottom div. So far I have this:

css:

    .logo{
        width: 200px;
        height: 100px;
        background-color: #519CC4;
        float: left;
        text-align: center;
    }

    .barofcolour{
        width: 200px;
        height: 100px;
        background-color: #51B9C4;
        float: left;
        position: absolute;
    }

body:

<div class="logo">
      <!--put text here-->
</div>
<div class="barofcolour">
      <!--or here-->
</div>

jQuery:

    $(document).ready(function(){
        $(".barofcolour").hover(function(){
            $(".barofcolour").fadeTo("1000", 0);
            },function(){
            $(".barofcolour").fadeTo("1000", 1);
        });
    });

So if anybody could give any insight as to how I could make some text sit ALWAYS on top of both the fading colour bar and the static bar of colour. That’d be nice.

  • 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-07T21:12:05+00:00Added an answer on June 7, 2026 at 9:12 pm

    If you always want the same text but just have the background color change, you could use CSS transitions instead of fading an overlapping div:

    HTML

    <div class="logo">
          Text 
    </div>​
    

    CSS

    .logo{
        width: 200px;
        height: 100px;
        background-color: #519CC4;
        float: left;
        text-align: center;
    
        transition: background-color 1s;
        -moz-transition: background-color 1s; /* Firefox */
        -webkit-transition: background-color 1s; /* Safari and Chrome */
        -o-transition: background-color 1s; /* Opera */
    }
    .logo:hover { background-color: #51B9C4; }
    

    ​Demo

    Edit: If you want to use a jQuery solution, you could also do something like this:

    $(document).ready(function(){
        $(".logo").hover(function(){
            $(this).animate({ backgroundColor: '#51B9C4'}, 1000);
            },function(){
            $(this).animate({ backgroundColor: '#519CC4'}, 1000);
        });
    });​
    

    Note that you would need either jQuery UI or some other color animation plugin (or write one yourself).

    Demo

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

Sidebar

Related Questions

I'm creating a jigsaw application. When each piece is touched, the idea is that
The Idea I have a main PHP page that loads content in DIV's from
I am using the following piece of jQuery code: $('div#addMenu1').click(function(){ if (!menuSet1){ menuSet1 =
I am basically trying to write a piece of c# that works with a
This piece of codes segment fault on me, any idea why? allButtons is a
One of the following pieces of code generates a memory leak, any idea which
idea Via jQuery, I was able to mark all :first-child and :last-child elements in
The idea is to walk over multiple dimensions, each one defined as a range
We have the following piece of code (idea for this code was found on
I have a piece of code that needs to do many computations based on

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.