Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Min-height auto ignored in iOS mobile

I have some list items set to min-height: 12em - for desktop

When sizing down for tablet / mobile screens I want to reset this to: min-height: auto

However iPad / iPhone is ignoring this and maintains the 12em

I've also set height: auto

like image 584
topiman Avatar asked Apr 23 '13 11:04

topiman


People also ask

What is min height Auto?

Defines the min-height as an absolute value. <percentage> Defines the min-height as a percentage of the containing block's height. auto. The browser will calculate and select a min-height for the specified element.

How do I get rid of min height?

Conversation. CSS tip: To reset a min-height or min-width declaration, set it to "0", not "auto". For max-height/width, the initial value is "none".

Can I use height and Min height together?

The min-height property in CSS is used to set the minimum height of a specified element. The min-height property always overrides both height and max-height . Authors may use any of the length values as long as they are a positive value.

What is min height Max content?

The max-content height is, roughly, the height the content would have if no “soft” line breaks were inserted, i.e., if each paragraph is one long line. The intrinsic minimum height. The min-content height is, roughly, the tallest the box can get by breaking all lines at all possible break points.


1 Answers

Use the following code:

/* Desktop */
.listings.default li {
    min-height: 12em;
} 

/* Between Desktop and Tablet */ 
@media only screen and (max-width: 1200px) and (min-width: 768px) { 
    .listings.default li {
        display: list-item;
        min-height: inherit;
    }
}

So use inherit instead of auto

I tested this on my iPhone but with another media query.. Check this post to see some of the media queries for standard devices..

like image 92
user2255273 Avatar answered Oct 20 '22 03:10

user2255273