Max Bottom a Popup Div

I have a popup divthat appears in the center of my screen:

 ---------------------------
 |           15%           |
 |     ---------------     |
 | 15% |             | 15% |
 |     |             |     |
 |     ---------------     |
 |          15%            |
 ---------------------------

I like the left side, the upper and right sides. But I don’t like the bottom.

I would like:

  • Adjust its size to heightcontent (I think that height: auto)
  • No more than a space 15%below.
  • Inside this divis meant a divchild divthat has overflow-y: auto, inside of which div(s) which float.

This was my code:

    #toPopup1, #toPopup2, #toPopup3 {
        font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
        border-radius: 3px 3px 3px 3px;
        color: #333333;
        display: none;
        font-size: 14px;
        margin-left: 15%;
        margin-right: 15%;
        position: fixed;
        top: 15%;
        bottom: 15%;
        width: 70%;
        z-index: 222;
        text-align: center;
    }

Then I deleted bottom:15%;using max-height:70%;, but the result I got was much smaller (almost one line in height), please report?

+3
source share
1 answer

:

bottom:15% max-height:70% div .

, div , , popup div 0 (+ , , ).

:

  • float div.
  • (, height:70%;)
  • display:inline-block; floats
+1

All Articles