如何在母版页的左侧和右侧添加边距/填充,同时仍然保留右侧的滚动条?

我不想要一个固定宽度的页面-只是缩放宽度,左右边距。

我看到的问题是一些JavaScript硬编码了s4-bodyContainer的内联宽度。这会抛出我试图添加到我的CSS中的任何边距/尝试(它溢出)。

我已经尝试了100%的宽度!重要的没有任何运气:

#s4-bodyContainer
{
    margin-left: 50px;
    margin-right: 50px; 
    width: 100% !important;
}
有帮助吗?

解决方案

我将在我的博客中找到所有需要完成的博客: http://www.n8d.at/blog/centerd-fixed-width-design-in-harepoint-2010-the-fast-fray/

您需要做的是:

div.s4-title.s4-lp,
 body #s4-mainarea,
 #s4-topheader2,
 #s4-statusbarcontainer{
     margin: 50px;
     padding: 0px;
     float: none;
     background-image: none;
     background-color: white;
}
.

1)您还有什么要做的:

<div id="s4-workspace">
.

至:

<div id="s4-workspace" class="s4-nosetwidth">
.

2)

<div id="s4-titlerow" class="s4-pr s4-notdlg s4-titlerowhidetitle">
.

需要改变:

<div id="s4-titlerow" class="s4-pr s4-notdlg s4-titlerowhidetitle s4-nosetwidth">
.

通过设置S4-NoSetWidth Class SharePoint将不会添加JavaScript来设置页面的宽度。 我还没有尝试过这个,但应该工作。

其他提示

彼得,

为此,我通常采取三个表 <td>, ,将bodycontainer包装在中间td,这样即使它的100%也不会超出 <td>...

然后是第一个和最后一个 <td> 用于间距/左右边距!给予 width=50px 到这两个td的

许可以下: CC-BY-SA归因
scroll top