Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[已解决] 我改了底部文件,可是无法居中。 请问如何解决

[复制链接]
icer2 发表于 2011-3-3 11:42:21 | 显示全部楼层 |阅读模式
问题描述
适用版本: Discuz! X1.5
浏览器: IE8 IE10 
使用模板: 官方模板
BUG地址: http://www.8kcc.com
情况是这样的:
我把自己的单页面的footer代码加到了风格的footer.htm里面
还加上了css代码
htm代码如下:

<div class="allcenter" style="width:960px; ">



<div id="footer2" >

      <div class="container">

  

<div class="main" >




    <ul>


    <li class="link"><strong><font color="#ff0000"><a href="http://www.8kcc.com"> 8K网赚论坛</a></font></strong> |<strong><font color="#0000ff"> <a href="http://www.8kcc.com/sitemap.php">最新项目</a> </font></strong>| <a href="http://www.itlaw.com.cn" target="_blank">法律顾问:ITLAW-庄毅雄律师</a> |


   
<a href="javascript:scroll(0,0)"></a><a href="#"></a> <a href="job.php?action=erasecookie&amp;verify=bbf2a23c">清除Cookies</a><a href="#"></a> | <a href="javascript:scroll(0,0)">返回顶部</a> <a href="http://www.itlaw.com.cn" target="_blank"></a> |


   
<script src="http://s13.cnzz.com/stat.php?id=2599472&web_id=2599472" language="JavaScript"></script>

    <li> 联系方式: QQ380067164 <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&amp;uin=380067164&amp;site=qq&amp;menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:380067164:46" alt="点击这里给我发消息" title="点击这里给我发消息" /></a></li>


<li><a href="http://www.itlaw.com.cn" target="_blank"></a>8K网赚论坛 - 致力于让每位网赚达人实现人生理想 </li>


<li>Copyright &copy; 2011-2012 Otuba.com All Rights Reserved Powered By <strong><a href="https://discuz.dismall.com/" target="_blank">Discuz!</a></strong> X1.5.</li>

</ul>








<a class="i" style="top:18px;right:5px" target="_blank" href="http://www.8kcc.com"></a></div>

  </div>
</div>
</div>
</div>





css代码:
    #footer2 {height:105px;  background:url(http://www.8kcc.com/img/8kcc.gif) repeat-x; overflow:hidden }


    #footer2 .container { height:105px; background:url(http://www.8kcc.com/img/foot-logogif.gif) no-repeat 42px 15px}


#footer2 .main { position:relative; height:105px; align:center; width:960;  overflow:hidden}


#footer2 ul { padding:25px 0 0 260px}


    #footer2 ul li { line-height:1.4; color:#FFFFFF}


    #footer2 ul li a { color:#FFFFFF}


    #footer2 ul li.link { color:#FFFFFF}


    #footer2 ul li.link a { color:#FFFFFF}


#footer2 .main a.i { position:absolute; right:0; top:0}




我把
<div class="allcenter" style="width:960px; ">
修改为
<div class="allcenter" style="width:960px; align:center;">
无任何效果.

然后把
    #footer2 {height:105px;  background:url(http://www.8kcc.com/img/8kcc.gif) repeat-x; overflow:hidden }
修改为
    #footer2 {height:105px; align:center; background:url(http://www.8kcc.com/img/8kcc.gif) repeat-x; overflow:hidden }
也我没有任何效果...

于是乎 我就又开始修改 footer.htm


<div class="allcenter" style="width:960px; ">



<div id="footer2" >

      <div class="container">

  

<div class="main" >

都加上了align="center";   
这次文字是居中了,  可是整体的底部框架 还是向左对齐的.
因为我的电脑分辨率是1024*768的.

我把分辨率调整为 1280*900
结果发现 整个底部框架都是向左的.  宽度是正确了..
如下图:


因为整个底部的css代码是调用的一个小图, 向X坐标无限填充 用了repeat-x; 这个代码.
我怀疑是跟这个有关系..
可是我不太会css


有会改的朋友, 麻烦教教. 万分感激..
回复

使用道具 举报

deviljing 发表于 2011-3-3 12:13:49 | 显示全部楼层
<div class="allcenter" style="width:960px;margin:0 auto ">

试着加是margin
回复

使用道具 举报

 楼主| icer2 发表于 2011-3-4 10:39:12 | 显示全部楼层
(EM:131:)

多谢楼上的兄台。。

已经完美解决了。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-8 16:36 , Processed in 0.121792 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表