Html HTM/CSS-粘性页脚未居中
我试图将一个粘脚居中,但没有用。这就是我所尝试的: HTML: 我使用的SharePoint 2013具有自定义(内部)主题。我不得不修改页脚部分(删除它),因为每当用户滚动时,我需要将页脚粘贴到底部Html HTM/CSS-粘性页脚未居中,html,css,position,sharepoint-2013,Html,Css,Position,Sharepoint 2013,我试图将一个粘脚居中,但没有用。这就是我所尝试的: HTML: 我使用的SharePoint 2013具有自定义(内部)主题。我不得不修改页脚部分(删除它),因为每当用户滚动时,我需要将页脚粘贴到底部 我做错了什么?首先,如果页脚有100%的宽度,为什么页脚有边距? 所以我去掉了边距,现在页面底部有一个100%宽的元素。 其次,您需要为居中div设置自动水平边距。 html: 小提琴: 删除页边距是与100%宽度相结合的唯一选项。除了@Pangloss所说的:如果被SharePoint取代,最终
我做错了什么?首先,如果页脚有100%的宽度,为什么页脚有边距?
所以我去掉了边距,现在页面底部有一个100%宽的元素。
其次,您需要为居中div设置自动水平边距。 html: 小提琴:
删除页边距是与100%宽度相结合的唯一选项。除了@Pangloss所说的:如果
被SharePoint取代,最终的HTML结构是什么?它是文本还是其他(块级)元素,使用text align:center不会居中代码>?sharepoint控件只有3个div,中间的div包含文本,左侧和右侧包含图像。不幸的是,上述解决方案均无效。页脚如下所示(未正确居中):。正如您所看到的,右侧有更多的空间。您确定这不是因为.footer be middle的内容没有填满您提供的空间吗?这段对话会让人很困惑。。。
<div class="footer-be">
<div class="footer-be-middle">
<eGov:EgovReusableContentControl runat="server" id="menuContent" ReusableContentListItemTitle="MasterPage_FooterMenus"/>
</div>
</div>
.footer-be {
position: fixed;
bottom: 0;
width: 100%;
z-index: 9999;
background-color: white !important;
font-family: "Calibri";
}
.footer-be-middle
{
text-align: center;
height: 100%;
overflow: hidden;
width: 60%;
margin: 0 auto;
}
<div class="footer-be">
<div class="footer-be-middle">
<eGov:EgovReusableContentControl runat="server" id="menuContent" ReusableContentListItemTitle="MasterPage_FooterMenus"/>
</div>
</div>
.footer-be {
position: fixed;
bottom: 0;
width: 100%;
z-index: 9999;
height: 80px;
background-color: red !important;
font-family: "Calibri";
}
.footer-be-middle
{
width: 50%;
margin: 0 auto;
text-align: center;
height: 100%;
overflow: hidden;
background-color: green;
}