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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:58:36+00:00 2026-05-22T02:58:36+00:00

As the title says my code is something like this : <div class=container> <img/>

  • 0

As the title says

my code is something like this :

<div class=container> <img/> <div>some text with line one, line two , line three </div> </div>

the container should have overflow:hidden and my text would be in more than one line , so I need only a small part of my text to appear at the bottom of container, so when user hovers, the full text appears.

I want to position text over img WITHOUT absolute positioning.
I tried negative margins, but text wouldn’t have BG color there.
Also tried Relative pos. => works great but not on chance on IE.

here is an image of what I want
enter image description here

  • 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-22T02:58:37+00:00Added an answer on May 22, 2026 at 2:58 am

    I see no reason not to use position: absolute.

    See: http://jsfiddle.net/NeaR4/

    CSS:

    .container {
        border: 2px dashed #444;
        float: left;
        position: relative
    }
    .container img {
        display: block
    }
    .container > div {
        position: absolute;
        left: 0;
        bottom: 0;
        right: 0;
        height: 14px;
        background: #000;
        background: rgba(0,0,0,0.7);
        color: #fff;
        overflow: hidden;
        font: bold 14px Arial, sans-serif;
        padding: 5px;
    }
    .container:hover > div {
        height: auto
    }
    

    HTML:

    <div class="container">
        <img src="http://dummyimage.com/230x180/f0f/fff" />
        <div>some text with line oneeee, line twoooooooo ooooooo , line three</div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just like the title says, Is there a simple line of code I could
Pretty much what the title says really. We have some code that is .NET
Like the title says, how do you create custom code snippets in Visual Studio
As the title says, I want to parse some Java source code in Java.
Like the title says, I have the following exception: Description: Event code: 3005 Event
As the title says, here's some code: - (void)refreshMap { NSLog(@refreshing); [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
Like the title says I want to use a color code instead of doing
The title description basically says it all. I'd like to use something that requires
As the title says. Related to this question. Why does the following code not
As title says, how do I call a java class method from a jsp,

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.