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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:55:54+00:00 2026-05-28T04:55:54+00:00

This is my first post here after many visits. Hello! I am trying to

  • 0

This is my first post here after many visits. Hello!

I am trying to make pop-up annotations on an image. I am using the CSS dropdown menu behavior to do this. You can see my example here

When you hover over the tip icon on the left, the container expands to reveal the text. But for the tip icon on the right, the text box extends outside of the image boundary.

How do I make the text box appear to the left of the icon so it stays within the image?
I used margin-left with a negative value but it also moves the tip icon.

Here is my code:

test

</head>
<body>

<style type="text/css"> 

.container {
z-index: 1000;
width: 15px;
height: 18px;
overflow: hidden;
position: absolute;
}
.container:hover {
width: 200px;
height: auto;
}

.copy {
font-size: 12px;
font-family: Helvetica, Verdana, Arial, sans-serif;
padding: 5px;
background-color: #ffcc99;
}

#painting {
margin: 0;
padding: 0;
width: 750px;
height: 530px;
background: url(painting.jpg) top left no-repeat #ffffff;
}

#tip1 {
left: 185px;
top: 60px;
}

#tip2 {
left: 698px;
top: 290px;
}

</style>


<div id="tip1" class="container">
    <div class="icon">
        <img src="tip_icon.png">
    </div>

    <div class="copy">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras libero ante, faucibus ac dictum eget, mollis ac erat. In porta velit vitae arcu vehicula ornare lacinia turpis accumsan. Quisque nec ligula non ligula elementum ultrices. Suspendisse commodo suscipit dapibus.</p>
    </div>
</div>

<div id="tip2" class="container">
    <div class="icon">
        <img src="tip_icon.png">
    </div>

    <div class="copy">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras libero ante, faucibus ac dictum eget, mollis ac erat. In porta velit vitae arcu vehicula ornare lacinia turpis accumsan. Quisque nec ligula non ligula elementum ultrices. Suspendisse commodo suscipit dapibus.</p>
    </div>
</div>

<div id="painting">
    </div>

</body>

I am still learning CSS so I appreciate any help

  • 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-28T04:55:54+00:00Added an answer on May 28, 2026 at 4:55 am

    This is my solution to this problem: http://jsfiddle.net/CwgDQ/1/
    Instead of overflowing the content of the container hide it by default and show on :hover.
    Add position:absolute to .copy and #tip2 .copy { ...; right:0 } should do the trick.

    EDIT (copy of CSS)

    .container {
        z-index: 1000;
        position: absolute;
    }
    
    .container:hover {
        height: auto;
    }
    
    .container .copy {
        display:none;
    }
    
    .container:hover .copy {
        display:block;
        width: 200px;
    }
    
    .copy {
        font-size: 12px;
        font-family: Helvetica, Verdana, Arial, sans-serif;
        padding: 5px;
        background-color: #ffcc99;
        position:absolute;
    }
    
    #painting {
        margin: 0;
        padding: 0;
        width: 750px;
        height: 530px;
        background: url(http://www.troyoxford.com/paint/painting.jpg) top left no-repeat #ffffff;
    }
    
    #tip1 {
        left: 185px;
        top: 60px;
    }
    
    #tip2 {
        left: 698px;
        top: 290px;
    }
    
    #tip2 .copy {
        right:0
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first post here and I wanted to get some input from
This is my first post here. I have a problem. I need to take
this is my first post here on stackoverflow and am very impressed by the
Well, this is my first post here and really enjoying the site. I have
My first post here, so i hope this is the right area. I am
This is my first time here so I hope I post this question at
this is my first post here. First off, some background, I'm new to C#
This is my first post on here and I'm very new to iPhone developing,
this is my first post here so I hope I provide all the right
I'm new to Objective-C. This is my first post here. I created a singleton

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.