mcan
mcan

Reputation: 2082

Height Percentage

I want to keep height of the textarea 50% of the frame's height in DEMO. If i resize the height of the result frame, textarea's height isn't change dynamically. How can i do that?

    html, body {
    line-height: 1;
    background:#F8F8F8;
    font-size: 22px;
    height: 100%;
    width: 100%;
}


#text {
    width: 95%;
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 10px;
    clear:both;
}



#textArea {
    width: 95%;
    height:auto !important; /* real browsers */
    height:50%; /* IE6: treaded as min-height*/

    min-height:50%; /* real browsers */
    max-width: 902px;
    margin-left: auto;
    margin-top: 5px;
    background-color: blue;
}

Upvotes: 0

Views: 334

Answers (2)

Sobin Augustine
Sobin Augustine

Reputation: 3765

change the css

#textArea {
        width: 95%;
        height:50% !important;     
        min-height:50%; 
        max-width: 902px;
        margin-left: auto;
        margin-top: 5px;
        background-color: blue;
    }

Upvotes: 0

frydoubt
frydoubt

Reputation: 77

You have the !important value in your height: auto property, so that auto is always going to override anything else you try to apply to height.

Upvotes: 1

Related Questions