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 am not sure whether I am asking a dumb question again or not
I am not sure whether this is just a simple mistake of my code.
Not sure whether it is sensible reopen my earlier thread on Hashing URL .
Consider the following regex: (([^\|])*\|)*([^\|]*) This matches repetitive string patterns of the type (whatever
I am trying to write a ruby app to update Google Contact Photos but
How do I go about Authorization in MVC 2? I want to use AD
I'm currently working on a user complaint, and I can't figure out whether the
In my application, most public posts seem to return 'false' when accessed via the
I'm trying to validate my form. In my form is a phone number field.

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.