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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:11:20+00:00 2026-06-01T02:11:20+00:00

So I am trying to use the CSS hack to set the max-height for

  • 0

So I am trying to use the CSS hack to set the max-height for a div in IE8 like this

height: expression( this.scrollHeight > 333 ? "333px" : "auto" );

I was wondering if anyone knew of a way to change that to a percentage, instead of a fixed pixel size? It would be fantastic if you could. Thanks!

Basically, I just want to say if this.scrollHeight is > window.height * .75 or something.

-Geoff

  • 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-01T02:11:21+00:00Added an answer on June 1, 2026 at 2:11 am

    Not sure exactly what you want to accomplish but it can be done without javascript like this:

    http://jsfiddle.net/KFyM4/6/

    The trick is this:

    max-height:33%;height:auto !important;height:33%;
    

    And it works even in IE6. The only catch is that the parent element has to have a fixed height set so that it knows from what number to calculate the %.

    So if you are doing it on browser window you will have to get the height of window and apply it to your body trough javascript – rest can be done trough css.

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

Sidebar

Related Questions

I'was trying to use css counter... This is my css code: div.primaries div.entries>div.meaning:first-child:before {
I am trying to use one CSS class to many DIV. Is it a
trying to use blueprint css framework, but can't understand why this is happening. I
I'm trying to use css to put some images this way: |_________<img1_1>|___<img2_1>| | |<___img2_2>|
I am trying to use CSS to size an image to the height of
I'm trying to use <div> objects and CSS to emulate the appearance of frames
I am trying to use css to position two div 's, one directly above
I am trying to use an image for a submit buttin like this <input
I'm trying to use CSS ( under @media print ) and JavaScript to print
I'm trying to use the CSS word-wrap property with break-word value. I want to

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.