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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:07:44+00:00 2026-06-13T10:07:44+00:00

I have this example: http://jsfiddle.net/WkpL9/ HTML: <div class=span2> <div class=image-container> <img alt= src=http://placehold.it/150×120/> <p>asdadsadasdasdsadasdasdasdasdsadsad</p>

  • 0

I have this example: http://jsfiddle.net/WkpL9/
HTML:

<div class="span2">
    <div class="image-container">
        <img alt="" src="http://placehold.it/150x120"/>
        <p>asdadsadasdasdsadasdasdasdasdsadsad</p>
    </div>
</div>

CSS:

.image-container {
    position: relative;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.image-container img {
    max-height: 150px;
}

.image-container p {
    white-space: nowrap;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    position: absolute;
    bottom: 0px;
}

I would like the caption of the image to be:
1. positioned over the image (in the top layer).
2. placed vertically in the bottom of the image.
3. with ellipsis.
4. will not get out of the wrapping div.

Is this possible?

I am using twitter bootstrap.

  • 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-13T10:07:45+00:00Added an answer on June 13, 2026 at 10:07 am

    I would do that with position: relative; and position: absolute;, like so:

    .image-container {
        position: relative;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }
    
    .image-container img {
        max-height: 150px;
    
        position: relative;
    
    }
    
    .image-container p {
        white-space: nowrap;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        position: absolute;
        bottom: 0px;
    
        position: absolute;
        top: 0;
        left: 0;
    
        text-align: center /* Not sure if I misunderstood you with this */
    
    }
    
    
    .image-container img {
        margin-top: 15px;
    }
    

    Regarding the ellipsis, then you can add this: &hellip; after the text. Was that what you meant?

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

Sidebar

Related Questions

Consider this example: http://jsfiddle.net/treeface/P8JbW/ HTML : <div id=test> <img src=http://ycombinator.com/images/y18.gif /> </div> CSS :
i have this simple example here : http://jsfiddle.net/pTyvc/1/ i don't want the sub_menu div
Lets say I have this kind of set of images: <div class=image><img src=image1.jpg alt=
I have a problem that is summarized in this simple example: http://jsfiddle.net/2wFHX/ I need
I have used this example to get a right click menu working. http://gmap3.net/examples/context-menu.html I
http://jsfiddle.net/AYPze/9/ In this example I have two similar divs with the same goal. Bind
I have this example http://jsfiddle.net/HnfCU/ I use jQuery to show and hide the .child
In this example: http://jsfiddle.net/ga89T/10/ I have 3 Sections (section 1, section 3 and section
I have this example here to illustrate the situation: http://jsfiddle.net/nubrF/40/ If you hold your
I prepared a jsfiddle example: http://jsfiddle.net/PEH7t/11/ The problem is that I have a container

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.