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

  • Home
  • SEARCH
  • 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 8343411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:03:11+00:00 2026-06-09T06:03:11+00:00

The problem isn’t so simple (as you would probably imagine), take the following example:

  • 0

The problem isn’t so simple (as you would probably imagine), take the following example:

The HTML:

Text text text <div id="special-image"></div> special content More text text text text... 

How I would like the output to look like:

enter image description here

As you can see the #special-image is “hovering” over the content without touching it.
I know the first thing that comes to mind is position:absolute;
But as you can see in the example image, I want those divs to be position:relative to the
area where they are setted (in the html). And the x,y positions can vary from page
to page (they are not consistent).

The text in the page should stay “anchored” in the page, I can’t give it absolute positions. The main point is that I don’t want the #special-image div to move any of the text and just hover there.

What would you suggest I should do in-order to achieve this kind of behavior?

Thanks in advance.

Edit:
This is one step closer (thanks to @Ross McLellan),
But the newly created divs are pushing the content:
http://jsbin.com/isepow/1/

And I need an image instead of the orange background.

  • 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-09T06:03:12+00:00Added an answer on June 9, 2026 at 6:03 am

    I suppose it can be achieved with some negative margin if you know the width of the image/image holder

    Not working in IE7…

    <div>Text text text <div id="special-image" style="display: inline-block; position: relative; top: -15px; left: -15px; width: 40px; margin-right: -40px; background-color: #ff6600;">&nbsp;</div> special content More text text text text... </div>
    

    Not Working in Chrome…

    <div>Text text text <div id="special-image" style="position: absolute; margin-top: -15px; margin-left: -5px; width: 40px; background-color: #ff6600;">&nbsp;</div> special content More text text text text... </div>
    

    Alternative solution if an extra wrapper is allowed:

    <div>Text text text <div style="position: absolute; display: inline;"><div id="special-image" style="display: inline-block; position: relative; top: -15px; left: -15px; width: 40px; background-color: #ff6600;">&nbsp;</div></div> special content More text text text text... </div>
    

    Outer wrapper holds the position absolute style. Which allows special-image to move relatively without impacting the rest of the page

    EDIT
    Possibly fixed the IE7 isssues with using margins. Not sure why but it was the fact they were on a <div>, using a span instead and it looks happy (without moving any of the other text as far as I can see on my test)

    Text text text<span id="special-image" style="position: relative; top: -15px; left: -15px; display: inline-block; width: 40px; margin-right: -40px; background-color: #ff6600;">&nbsp;</span> special content More text text text text...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem isn't with the built-in eval procedure but how to create a simplistic
I know my question isn't about programming problem, I just need a suggestion to
The problem is, that the blank row in the DataGrid isn't appearing, ergo user
This problem may seem like school work, but it isn't. At best it is
Isn't Makefile syntax is target: require_files cmd... Why I got this problem? Makefile MXMLC
This sounds confusing but isn't. Here is the problem: application is hosted at www.site.com/app
If the title isn't clear enough, here's a procedural way of approaching the problem:
I can't see where is problem, but .topbar isn't centered as it should be...
At work I'm using Netbeans with Tomcat 6 without any problem. Tomcat isn't bundled
Yes I know, this title isn't really helpfull but this is the exact problem.

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.