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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:54:48+00:00 2026-05-27T11:54:48+00:00

I have an image container based on Jquery Mobile listview element structure. Looks like

  • 0

I have an image container based on Jquery Mobile listview element structure.

Looks like this:

<li>
 <div class="ui-btn-inner">
  <div class="ui-btn-text">
    <a>
     <img src="img/products/l/demo2.jpg">
     <h3>product2</h3>
    </a>
  </div>
 </div>
</li>

I’m overriding JQM-CSS to create an image gallery-list. Images and h3 are both contained inside a link element. As the images can have different heights, I want to set a CSS fixed-height/overflow:hidden to the link element to cut off images at the top using vertical align: top.

Here is my CSS so far:

 li {
    display: inline-block;
    min-width: 200px;
    max-width: 300px;
    width: 24%;     
    }
 li img {
    width: 100%; 
    position: static !important;    
    max-width: 185px; 
    max-height: inherit;
    }
 // fix height and overflow hidden
 li a {
    height: 100px;
    overflow: hidden;
    vertical-align: bottom;
    }

It doesn’t work… If I check on Firebug, the element-height is set to 100px, but it covers the image top versus covering the image bottom and h3, which I do not want to crop away.

I have tried setting line-height to 100px as well, but this does not work at all.

Any hints on what I’m doing wrong?

Thanks!

EDIT:
Can’t use clip either, because I don’t know at what height I want to start (img.height-100px) and I cannot clip from the bottom. Or can I?

SOLUTION:
It would work like this:

li a {
  position:absolute;
  bottom: 0;
  left: 0;
  }
li div.ui-btn-text {
 position: relative;
 height: 100px;
 overflow: hidden;
 }

Doesn’t use vertical-align but the result is ok.

  • 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-27T11:54:49+00:00Added an answer on May 27, 2026 at 11:54 am

    I’m afraid that can’t work. Adding display:block; to your link and would be a start for your method, but check the result: http://jsfiddle.net/uu96D/

    vertical-align: bottom; won’t push the a tag to the bottom of the container. Here is a guide of how vertical-align works: http://phrogz.net/css/vertical-align/index.html

    To solve your problem i’d go to some js solution, and add a negative top margin to the image if its taller than, for example, 80px. Here’s a fiddle with the result: http://jsfiddle.net/uu96D/1/

    And the code using jQuery:

    $('img').each(function(){
        var height = $(this).height();
        if (height > 80) {
            $(this).css({marginTop: "-" + (height-80)});
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image <div class='container'> <img src='../images.jpg' alt='images' /> </div> I want to
I have a container (div) with a background image. In this div there is
I have this jquery plugin that zooms in on photos, but I would like
I have a container that contains an image that I need to drag from
I have one scrolling image which is in jQuery, it scrolls and logos of
I have this bit of javascript written with jQuery 1.2.5. It's contained inside the
I've designed and build game based on UINavigationController. I have several ViewControllers like on
I'm working with Javascript/jQuery and CSS to have a "background" image of a map
I am building a simple image gallery based on the following markup: <div id=image-list>
I have a form which is like: class Address_info_updateForm(forms.Form): street = forms.CharField(label=_(Street), required=True) street2

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.