如何在magento中居页脚链接?

时间:2015-09-01 15:57:52

标签: html css magento

亲爱的Stackoverflow社区,

我无法弄清楚如何将我的magento网站上的页脚链接居中。页脚链接在div内,相应的CSS,如我所知,如下:

我已尝试过所有内容,从margin:auto到margin-right和margin-left auto。 然后我想,也许是右脚,那里曾经有一个时事通讯盒,迫使占用空间,所以我把它砍掉了,但仍然没有效果。任何人都知道什么是解决方案?非常感谢你!

 .footer-container { width:100%; text-align: left;}
.footer { margin: 0 auto 0;width: 940px; padding: 0 20px 30px; background: #fff; }
.aditional-footer { margin:0 auto 0; padding: 30px 20px 35px; width: 940px; background: #FFF;}
.footer .links li { text-transform: none;}
.footer-container a { color:#666669; font-size: 9px; }
/*.footer-container .footer-right { width: 250px; }*/

.footer .f-left { width:520px; text-align: left;   margin: 0 auto;}
/*.footer .f-right { width:420px; text-align: right; }*/

这是HTML

<html>
<div class="footer-container">
    <div class="aditional-footer">
        <?php echo $this->getChildHtml('bottomContainer') ?>
        <div class="f-right">
            <div class="footer-right">
                <div class="right-conteiner">
                    <?php echo $this->getChildHtml('newsletter') ?>
                    <div class="clear"></div>
                </div>
                <div class="right-conteiner">
                    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_time')->toHtml(); ?>
                    <?php if(themeOptions('topbtn')): ?>                    
                        <div id="back-to-top"><a href="#top" id="top-link"><?php echo $this->__('Back to top') ?></a></div> 
                    <?php endif; ?>
                    <div style="clear: both;"></div>
                </div>                
            </div>
        </div>

        <div class="f-left footer-left">
            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_shipping')->toHtml(); ?>
        </div>
        <div style="clear: both;"></div>
    </div>  
</div>  
    <div class="footer">
        <?php echo $this->getChildHtml('bottomContainer') ?>
        <div class="f-left">
            <?php echo $this->getChildHtml('footer_links') ?><br />
            <?php echo $this->getCopyright() ?>&nbsp;&nbsp;
            <?php echo $this->getChildHtml('cms_footer_links') ?>
        </div>
        <div class="f-right">
            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('verify')->toHtml(); ?>
        </div>
    </div>
</html>

1 个答案:

答案 0 :(得分:0)

更改以下代码

.footer-container { width:100%; text-align: left;}

.footer-container { width:100%; text-align: center;}

如果您有任何疑问,请告诉我