How can I resize the width of an element when collapse panel is expanded?
<p>I am using the web application template that comes with visual studio. I have added a nested master page that splits the main content into two other content place holders, both of which are wrapped in divs that have css styling applied to them in an attempt to control their widths. One is used as the main content area for each page that inherits from this nested master page and, the other content place holder is used as a side panel that can be be expanded and collapsed left to right. This side panel will be persistent across most pages. That is why its in a content place holder so that in a page that doesnt need it can create custom content and then just leave it blank or use other data. This functionality has been achieved with the collapsible panel extender from ajax but, the size of the main content area is has a locked width. In my css I set max-width and min-width on the main content area but it only sets it to the min-width. Upon reading css documentation I have discovered that the min-width property overrides the max-width and width properties. My question is How do I get the main content area to be 95% in width when the side panel is collapsed and 75% in width when the side panel is expanded? I've tried to include as much relevant information as I could think of but if more is needed I will gladly provide it.</p>

<p>The relevant markup from my nested master page</p>

<pre><code>&lt;asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"&gt;
&lt;div style="width: 100%; height: 100%;"&gt;
    &lt;div class="leftSidePanel"&gt;
    &lt;asp:ContentPlaceHolder ID="LeftSidePanelContent" runat="server"&gt;        
        &lt;asp:Panel ID="Panel2" runat="server" CssClass="collapseLeftSidePanelHeader" &gt;
            &lt;div style="padding: 5px; cursor: pointer; vertical-align: middle;"&gt;
                &lt;asp:ImageButton ID="Image1" runat="server" ImageUrl="~/Images/CollapsiblePanel/expand_blue.jpg" AlternateText="(Show Details...)" /&gt;
            &lt;/div&gt;
        &lt;/asp:Panel&gt;
        &lt;asp:Panel ID="Panel1" runat="server" CssClass="collapseLeftSidePanel" &gt;
            &lt;br /&gt;

            &lt;asp:Label ID="Label1" runat="server" Text="MY PANEL"&gt;&lt;/asp:Label&gt;
            &lt;/asp:Panel&gt;
            &lt;ajax:collapsiblepanelextender ID="cpeLeftSidePanel" runat="Server"
                ExpandedSize="250"
                CollapsedSize="0"
                ExpandDirection="Horizontal"
                TargetControlID="Panel1"
                ExpandControlID="Panel2"
                CollapseControlID="Panel2"
                Collapsed="True"
                TextLabelID="Label1"
                ImageControlID="Image1"
                ExpandedImage="~/Images/CollapsiblePanel/collapse_blue.jpg"
                CollapsedImage="~/Images/CollapsiblePanel/expand_blue.jpg"
                SuppressPostBack="true" /&gt;
    &lt;/asp:ContentPlaceHolder&gt;
    &lt;/div&gt;
    &lt;div class="mainPanel"&gt;
        &lt;asp:ContentPlaceHolder ID="MainPanelContent" runat="server"&gt;
        &lt;/asp:ContentPlaceHolder&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<p>The relevant css: the width for the collapse panel is set in the collapsible panel extender</p>

<pre><code>.main
{
    padding: 0em 1em;
    margin: 1em;
    width: 100%;
    min-height: 420px;
    border: thin solid black;
}

.mainPanel{
    max-width: 90%;
    min-width: 75%;
    height: 100%;
    float:right;
    border: thin solid green;
}

.leftSidePanel{
    min-width: 0;
    max-width: 20%;
    height: 100%;
    float: left;
    border: thin solid blue;
}


.collapseLeftSidePanelHeader{
    width:30px;
    height:100%;
    background-repeat:repeat-y;
    background-color: AliceBlue;
    font-weight:bold;
    float: right;
}

.collapseLeftSidePanel {
    background-color:black;
    overflow:hidden;
    width:0;
    height: 100%;
}
</code></pre>