调整ajax asp手风琴大小

时间:2011-11-13 14:27:06

标签: asp.net css ajax ajaxcontroltoolkit

我对手风琴非常不熟悉以及如何使用它们,我正在尝试调整手风琴的宽度,如何/更简单的方法,我正在使用随附的示例css它,但我没有看到任何宽度调整。

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="Server" />
<asp:Accordion ID="MyAccordion" runat="server" 
                       SelectedIndex="0" 
                       HeaderCssClass="accordionHeader" 
                       ContentCssClass="accordionContent" 
                       FadeTransitions="true" 
                       FramesPerSecond="40" 
                       TransitionDuration="250"
                       AutoSize="None">
 <Panes>
      <asp:AccordionPane ID = "AccordionPane1" runat = "server">
      <Header>
        <a href = "" onclick = "return false;" class = "accordionLink"> Section 1</a>
      </Header>
      <Content>
        <p>Thi</p>
      </Content>
    </asp:AccordionPane>

    <asp:AccordionPane ID = "AccordionPane2" runat = "server">
      <Header>
        <a href = "" onclick = "return false;" class = "accordionLink"> Section 2</a>
      </Header>
      <Content>
        <p>Joe</p>
      </Content>
    </asp:AccordionPane>

    <asp:AccordionPane ID = "AccordionPane3" runat = "server">
      <Header>
        <a href = "" onclick = "return false;" class = "accordionLink"> Section 3</a>
      </Header>
      <Content>
        <p>So keep yoow Micro</p>
      </Content>
    </asp:AccordionPane>

    <asp:AccordionPane ID = "AccordionPane4" runat = "server">
      <Header>
        <a href = "" onclick = "return false;" class = "accordionLink"> Section 4</a>
      </Header>
      <Content>
        <p>>test</p>
      </Content>
    </asp:AccordionPane>
 </Panes>
 </asp:Accordion>


.accordionHeader
{
    border: 1px solid #2F4F4F;
    color: white;
    background-color: #2E4d7B;
    font-family: Arial, Sans-Serif;
    font-size: 12px;
    font-weight: bold;
    padding: 5px;
    margin-top: 5px;
    cursor: pointer;
}

.accordionContent
{
    background-color: #D3DEEF;
    border: 1px dashed #2F4F4F;
    border-top: none;
    padding: 5px;
    padding-top: 10px;
}

.accordionLink
{
 background-color: #D3DEEF;
    color: white;
}

.watermark {
    background: #FFAAFF;
}

.popupControl {
    background-color:#AAD4FF;
    position:absolute;
    visibility:hidden;
    border-style:solid;
    border-color: Black;
    border-width: 2px;
}

.modalBackground {
    background-color:Gray;
    filter:alpha(opacity=70);
    opacity:0.7;
}

.modalPopup {
    background-color:#ffffdd;
    border-width:3px;
    border-style:solid;
    border-color:Gray;
    padding:3px;
    width:250px;
}

.sampleStyleA {
    background-color:#FFF;
}

.sampleStyleB {
    background-color:#FFF;
    font-family:monospace;
    font-size:10pt;
    font-weight:bold;
}

.sampleStyleC {
    background-color:#ddffdd;
    font-family:sans-serif;
    font-size:10pt;
    font-style:italic;
}

.sampleStyleD {
    background-color:Blue;
    color:White;
    font-family:Arial;
    font-size:10pt;
}

1 个答案:

答案 0 :(得分:0)

你可以为手风琴创建一个容器,并给它一个宽度,也可以设置手风琴的宽度。类似的东西:

<div id="divAccordionContainer" style="width:500px">
    <ajaxToolkit:Accordion ID="MyAccordion" runat="Server">
        ...
    </ajaxToolkit:Accordion>
</div>