title: CSS max-height and max-width at the same time not working in IE8?
body: <p>I have the following css defined in a style applied to a panel in my aspx page.</p>
  
  <pre><code>max-height: 70%; overflow: auto;
  max-width: 70%; overflow: auto;
  </code></pre>
  
  <p>In Mozilla, I can resize my browser window and the panel will properly display scroll bars when the browser window becomes too small to contain the full content of the panel.  This works great.</p>
  
  <p>In IE8, the max-height css appears to have higher priority than the max-width css.</p>
  
  <p>For instance:</p>
  
  <p>1) When making the browser window smaller vertically, the width scrollbar will show up properly on the bottom of the panel.</p>
  
  <p>2) When making the browser window smaller horizontally, the height scrollbar will show up properly on the bottom of the panel.</p>
  
  <p>3) When making the browser window smaller vertically, the width scrollbar will show up properly on the bottom of the panel, but then if I continue to make the browser window smaller horizontally as well, then the height scrollbar appears, but the width scrollbar disappears. If I make the browser window long enough to accomodate the height of the panel, then the width scrollbar reappears.</p>
  
  <p>How do I make IE8 show both scroll bar when appropriate instead of just the height one?  This works correctly in Firefox.</p>
  
  <p>Here is a sample page that exhibits the problem exactly as it exists in my primary page.  Click on "Show Popup" and then try to make the browser screen smaller.  You'll see the popup scroll bars behave the way described above.</p>
  
  <pre><code>    &lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="css.aspx.cs" Inherits="Sandbox.css" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;style type="text/css"&gt;
      .Background
      {
          filter: Alpha(Opacity=40); 
          opacity: 0.4;
          background-color: #CCCC99;
          z-index:1000;
      }
      .Popup
      {
        border: solid 1px #c0c0c0;
        background:#FFFFFF;
        padding: 0px 10px 10px 10px;
        position:absolute;
        padding-top: 10px;
        max-height: 90%; overflow: auto;
        max-width: 90%; overflow: auto;
      }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;asp:scriptmanager ID="Scriptmanager1" runat="server"&gt;&lt;/asp:scriptmanager&gt;
      &lt;asp:Button ID="Button1" runat="server" Text="Show Popup" /&gt;
      &lt;asp:panel ID="Panel1" runat="server" ScrollBars="Auto" CssClass="Popup"&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label1" runat="server" Text="Label1"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox2" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label2" runat="server" Text="Label2"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox3" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox6" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label3" runat="server" Text="Label3"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox4" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox5" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label4" runat="server" Text="Label4"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox7" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox8" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
          &lt;asp:Button ID="Button2" runat="server" Text="Ok" /&gt;
          &lt;asp:Button ID="Button3" runat="server" Text="Cancel" /&gt;
      &lt;/asp:panel&gt;
      &lt;ajaxToolKit:ModalPopupExtender runat="server" TargetControlID="Button1" PopupControlID="Panel1" 
      BackgroundCssClass="Background" OkControlID="Button2" CancelControlID="Button3" /&gt;
      &lt;table&gt;
      &lt;tr&gt;
      &lt;td&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label5" runat="server" Text="Label1"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox9" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox10" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label6" runat="server" Text="Label2"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox11" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox12" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label7" runat="server" Text="Label3"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox13" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox14" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label8" runat="server" Text="Label4"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox15" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox16" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label9" runat="server" Text="Label1"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox17" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox18" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label10" runat="server" Text="Label2"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox19" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox20" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label11" runat="server" Text="Label3"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox21" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox22" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="Label12" runat="server" Text="Label4"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox23" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="TextBox24" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And the codebehind:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace Sandbox
  {
      public partial class css : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
      }
  }
  </code></pre>