css 背景不随模态框内容拉伸

发布于 2024-08-15 02:36:08 字数 2016 浏览 2 评论 0原文

我已经更改了模式登录窗口/弹出窗口的 css 文件。问题是,当我使用登录表单时,底部和右侧有一些滚动条。我想到了拉伸登录对话框,使其更宽、更高的想法。现在的问题是背景不会随着新的尺寸而拉伸。

高度和宽度原来是 100%

#sbox-content
{
    clear:                  both;
    overflow:               auto;
    background-color:       #fff;
    height:                 130%;
    width:                  160%;
}

这是完整的 css 文件,有人可以解释一下要编辑什么以及在哪里编辑以使背景适合新尺寸吗?也许有更好的解决方案,不必将原来的 100% 尺寸设置为 130% 和 160%

.body-overlayed embed, .body-overlayed object, .body-overlayed select
{
    visibility:             hidden;
}

#sbox-window embed, #sbox-window object, #sbox-window select
{
    visibility:             visible;
}

#sbox-overlay
{
    position:               absolute;
    background-color:       #FFFFFF;
}

#sbox-window
{
    position:               absolute;
    background-color:       #FF7400;
    text-align:             left;
    overflow:               visible;
    padding:                5px;
    -moz-border-radius:     3px;
}

* html #sbox-window
{
    top: 50% !important;
    left: 50% !important;
}

#sbox-btn-close
{
    position:               absolute;
    width:                  30px;
    height:                 30px;
    right:                  -120px;
    top:                    -15px;
    background:             url(../images/closebox.png) no-repeat top left;
    border:                 none;
}

.sbox-loading #sbox-content
{
    background-image:       url(../images/spinner.gif);
    background-repeat:      no-repeat;
    background-position:    center;
}

#sbox-content
{
    clear:                  both;
    overflow:               auto;
    background-color:       #fff;
    height:                 130%;
    width:                  160%;
}

.sbox-content-image#sbox-content
{
    overflow:               visible;
}

#sbox-image
{
    display:                block;
}

.sbox-content-image img
{
    display:                block;
}

.sbox-content-iframe#sbox-content
{
    overflow:               visible;
}

I have changed a css file for a modal login window/popup. The problem was that when I used the login form, I have some scrollbars at the under and on the right side. I came up with the idea to stretch the login dialog to make it all wider and heigher. The problem now is that the background doesn't stretch with the new dimentions.

The height and the width was originally 100%

#sbox-content
{
    clear:                  both;
    overflow:               auto;
    background-color:       #fff;
    height:                 130%;
    width:                  160%;
}

This is the complete css file, can somebody explain me what and where to edit to make the background, fit the new dimentions? Maybe there is a better sollution without having to set the original 100% sizes to 130% and 160%

.body-overlayed embed, .body-overlayed object, .body-overlayed select
{
    visibility:             hidden;
}

#sbox-window embed, #sbox-window object, #sbox-window select
{
    visibility:             visible;
}

#sbox-overlay
{
    position:               absolute;
    background-color:       #FFFFFF;
}

#sbox-window
{
    position:               absolute;
    background-color:       #FF7400;
    text-align:             left;
    overflow:               visible;
    padding:                5px;
    -moz-border-radius:     3px;
}

* html #sbox-window
{
    top: 50% !important;
    left: 50% !important;
}

#sbox-btn-close
{
    position:               absolute;
    width:                  30px;
    height:                 30px;
    right:                  -120px;
    top:                    -15px;
    background:             url(../images/closebox.png) no-repeat top left;
    border:                 none;
}

.sbox-loading #sbox-content
{
    background-image:       url(../images/spinner.gif);
    background-repeat:      no-repeat;
    background-position:    center;
}

#sbox-content
{
    clear:                  both;
    overflow:               auto;
    background-color:       #fff;
    height:                 130%;
    width:                  160%;
}

.sbox-content-image#sbox-content
{
    overflow:               visible;
}

#sbox-image
{
    display:                block;
}

.sbox-content-image img
{
    display:                block;
}

.sbox-content-iframe#sbox-content
{
    overflow:               visible;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天生の放荡 2024-08-22 02:36:08

我不确定我理解这个问题,但也许您只需要:

#sbox-content
{
    clear:              both;
    overflow:           hidden;
    background-color:   #fff;
    height:             auto;
    width:              auto;
}

您能否通过在线工作测试用例来澄清?

编辑

感谢您的澄清。

似乎你应该在调用它时增加模式窗口的大小:

$("#sample").modal({
    minHeight:400,
    minWidth: 600
});

I'm not sure I understand the question, but perhaps you just need:

#sbox-content
{
    clear:              both;
    overflow:           hidden;
    background-color:   #fff;
    height:             auto;
    width:              auto;
}

Could you clarify with a working test-case online?

EDIT

Thanks for clarifying.

Seems you should increase the size of the modal window when you call it:

$("#sample").modal({
    minHeight:400,
    minWidth: 600
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文