我遇到了一个问题
我的页面页脚保持向下但不在中心。
现在右对齐
我想让它居中对齐。
早些时候它甚至没有停留但随后应用了下面提到的 .footerContent css。
应用 .footerContent 之后。它解决了我的页脚不在页面底部的问题。现在它在底部但显示广泛正确。页脚的一半被剪掉了。
你们能纠正并告诉我哪里出了问题吗。
我在此处附加屏幕,以便您可以定位页脚。 see here
继承标记
<body>
<form id="form1" runat="server">
<div id="wrapper">
<div id="header" runat="server">
<%-- Menu goes here --%>
</div>
<div id="masterpageContent" class="footer">
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
</div>
</div>
<div class="footerContent">
<div class="footerbrd">
</div>
<p class="clear">
</p>
<div class="footer">
<div class="c1 fleft">
Best viewed in IE8 and above with Resolution 1024x768
</div>
<div class="c2 fleft">
(c) Copyright 2013
<br />
All Rights Reserved.
</div>
<div class="c3 fright">
Site by abc Team
</div>
<p class="clear">
</p>
</div>
</div>
</form>
</body>
和这里的 css
/页脚开始/
.footerbrd {width:929px; height:1px; background:#ef0b14; margin:0px auto;}
.footer {width:929px; margin:0px auto; padding:5px 0px; color:#666666;}
.footer .c1 {width:300px; margin:0px; padding:0px;}
.footer .c2 {width:375px; margin:0px; padding:0px; text-align:center;}
.footer .c3 {width:254px; margin:0px; padding:0px 0px 0px 0px; text-align:right;}
ul.foot {list-style:none; padding: 0px 0px; margin: 0px;}
ul.foot li {list-style:none; float:left; line-height:12px;}
ul.foot li a {color:#666666; padding: 2px 10px; font-size:11px; text-decoration:none; display:block; float:left;}
.footerContent {
position: absolute;
height: 50px;
width: 929px;
margin: auto;
bottom: 0px;
}
/页脚结束/
最佳答案
在 .footerContent
中将宽度更改为 100%
并将其边距设置为 0 auto
。它应该适合你。
关于html - 在 asp.net 中使底部页脚居中对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19043922/