自动调整Ext.Msg.confirm的宽度和高度以适应它的内容

时间:2012-05-14 18:02:00

标签: javascript html5 css3 sencha-touch

我尝试将内容自动调整为Ext.Msg.confirm,但我不会尝试调整它。剩余的Ext.Msg.confirm调整为更大的内容大小。

我有这段代码:

标题

div.x-sheet.x-msgbox {
    width:15em;
    height:auto;
    background:#fff;
    -webkit-box-shadow: rgba(0,0,0,0.4)00.1em0.5em;
    -webkit-border-radius:0.3em;
    -moz-box-shadow: rgba(0,0,0,0.4)00.1em0.5em;
    -moz-border-radius:0.3em;
    border-radius:0.3em;
    border:0.15em solid #FFFFFF;
}

.x-msgbox-body {
    padding:40px0;
    padding:6px0;
    background-color:#ffffff;
    color:#094fa4;
    position:relative;
    margin:0auto;
    text-align: center;
    overflow: hidden;
}

请帮帮我

1 个答案:

答案 0 :(得分:1)

Sencha会自动将消息框的大小调整为文本量。你想覆盖它吗?

如果是这样,你可以将!important规则放在高度定义上,以覆盖消息框的sencha的css标记(尽管auto不会做任何事情):


div.x-sheet.x-msgbox {
    width:15em;
    height:115px !important;
    background:#fff;
    -webkit-box-shadow: rgba(0,0,0,0.4)00.1em0.5em;
    -webkit-border-radius:0.3em;
    -moz-box-shadow: rgba(0,0,0,0.4)00.1em0.5em;
    -moz-border-radius:0.3em;
    border-radius:0.3em;
    border:0.15em solid #FFFFFF;
}