0

我正在使用 HTML/CSS 模板来创建 Web 应用程序。由于某种原因,当我调整需要它们执行的窗口大小时,元素不会在模板上滑回。例如,如果我在右侧浮动一个按钮,它会将自身定位到全屏的最左侧。如果我然后水平收缩窗口,则按钮不会向后移动,而只是“被窗口隐藏”。几天来,我一直在查看模板 CSS 代码并到处搜索,但我仍然不知道是什么原因造成的。

在此处输入图像描述

这是模板的 CSS 代码:

body, html {
    padding:0;
    margin:0;
    font-family: BBAlpha Sans;
    font-size: 15pt;
    overflow:visible;
}

body {
    background-image: url('../images/stripes.png');
    overflow:hidden;
}


.listSeparator
{
    border-bottom: solid 1px Silver;
}

.label 
{
    display:inline; 
    float:left;
    line-height:40px;
    margin-left: 5px;
}

.row
{
    height: 40px;
    width:100%;
    vertical-align: middle;
}

.tab
{
    position:absolute;
    top:70px;   
    padding: 10px;
}

.main-panel 
{
    position:relative;
}

.panel-top-left {
    margin-right: 4px; 
    height: 4px; 
    background-image: url('../images/panel.png');
}
.panel-top-right {
    margin-top: -4px; 
    margin-left: 4px; 
    background-position: 100% 0; 
    height: 4px; 
    font-size: 2px;
    background-image: url('../images/panel.png');
}
.panel-bottom-left {
    margin-right: 9px; 
    background-position: 0 -7px; 
    height: 9px;
    font-size: 2px;
    background-image: url('../images/panel.png');
}
.panel-bottom-right {
    margin-top: -9px; 
    margin-left: 9px; 
    background-position: 100% -7px; 
    height: 9px; 
    font-size: 2px; 
    background-image: url('../images/panel.png');
}
.panel-inside {
    border-left: 2px solid #D6D3D6;
    border-right: 2px solid #D6D3D6;
    background: White;
    padding-left: 0px;
    padding-right: 0px;
    overflow:auto;
}
.panel-nogap {
    margin-top: -3;
    margin-bottom: -3;
}

.panel-nogap input 
{
    display:inline; 
    float:left;
    font-family: BBAlpha Sans;
    font-size: 16pt;
    border: none;
    padding-top: 0px;
    width: 10px;
    margin-top: 7px;
}

.buttonPanel
{
    margin-top: 5px;
    margin-left: 8px;
    margin-bottom: 0px;
    text-align:center;
    position:relative;

}

a.tabButton {
    background: transparent url('../images/tabs/tabRight.png') no-repeat scroll top right;
    color: White;
    display: block;
    float: left;
    height: 64px;
    margin-right: 5px;
    padding-right: 10px;  
    text-decoration: none;
    width: 28%;  
}

a.tabButton div {
    background: url('../images/tabs/tab.png') no-repeat top left;
    display: block;
    height: 64px;
    padding: 0px 0px 0px 10px;
    line-height: 0px;
}

a.tabButton p 
{
    font-size: 10pt;
    margin-top: 0px;    
    padding: 0px;
}

a.tabButton img 
{
    position:relative;
    height:35px;
    width:35px;
    margin-top: 5px;
    margin-bottom: 0px;
    padding: 0px;
}


.tabSeparator
{
    position: absolute;
    top:69px;
    background-color:#014EBE;
    height:5px; 
    width: 100%;
    z-index: -1;    
}

以及模板的外观:

在此处输入图像描述

如果有人知道是什么原因造成的,或者至少我应该寻找什么,任何帮助都将不胜感激。提前致谢!

4

1 回答 1

0

更改位置属性怎么样...固定将是您最好的选择:将其定位为固定@ 5em 从浏览器侧或其他东西:

http://www.w3schools.com/cssref/pr_class_position.asp

在 w3schools 上玩,这是一个很棒的网站 :)

于 2012-03-05T14:40:46.340 回答