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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:53:56+00:00 2026-05-23T21:53:56+00:00

I am not sure whether Stackoverflow is the right place for this question, but

  • 0

I am not sure whether Stackoverflow is the right place for this question, but I think it has something to do with Javascript.

Here is what I want to add to my webpage: a floating text box at the top of the webpage, you can close it by clicking the “X”.

Just like the YELLOW BOX in the following picture (Welcome to Q&A blah blah….):
enter image description here

I tried to Google but I dont know the right phrase for this.

I have read these two questions: CSS to achieve a similar fixed floating div thast always on top of other divs – like stackoverflow does? and div with fixed position.

But How to add the close it by clicking the “X” button at the right?

Also, I like the color of Stackoverflow’s floating text box so much. What the color is it?

Can someone give me the code that Stackoverflow uses?

Thanks a lot!

  • 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-05-23T21:53:57+00:00Added an answer on May 23, 2026 at 9:53 pm

    To add a closing button you could use javascript or jQuery if you use jQuery, you would do something like :

    HTML:

    <div id="yellowbar">
        <div id="xbtn">x</div>
    </div>
    

    javascript:

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <!-- load jquery-->
        <!--jquery code-->
        <script>
            $(function(){
                $("#xbtn").click(function(){
                    $("#yellowbar").hide();
                });
            });
    </script>
    

    simple example: http://jsfiddle.net/mazlix/dcY2A/2/

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

Sidebar

Related Questions

I'm not sure whether this question belongs on StackOverflow or SuperUser, but here goes
Not sure whether this is the right place, but I have a question related
I'm not quite sure stackoverflow is a place for such a general question, but
Not sure whether this is a MSMQ or NServiceBus question, but I'm wondering: Should
I'm not sure whether I'm asking the question correctly, but I've been told SQL
I am not sure whether it has been disscussed before or not but I
Not sure whether this pertains to VS 2010 or to the upgraded framework, but...
Not sure whether this should be asked here or on another site such as
I am not sure whether this has been asked before; I did a few
I'm not sure whether this belongs on StackOverflow or on ServerFault, so I've picked

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.