Center Bootstrap Row and Spans

时光毁灭记忆、已成空白 提交于 2019-12-06 13:49:24
<div id="footer">

        <div id="footer-content">


                <div id="footer-bottom" class="clear">



                      <div class="row" style="margin: 0 auto;">
<div class="span12" style="width:100%;">
<div class="span2 text-left">
<a href="https://twitter.com/WallSpaceOttawa"><img alt="twitter" class="social" src="<?php bloginfo('stylesheet_directory'); ?>/img/twitter.png"></a>
<a href="https://www.facebook.com/pages/Wall-Space-Gallery-and-Framing/195974620432391"> 
<img alt="facebook" class="social" src="<?php bloginfo('stylesheet_directory'); ?>/img/facebook.png"></a>
</div>

<div class="span6 text-center">

<h5>
  Copyright &#169; <script type="text/javascript">
//<![CDATA[
                                    var dteNow = new Date();
                                    var intYear = dteNow.getFullYear();
                                    document.write(intYear);
          //]]>
          </script>
          Wall Space Gallery And Framing - All Rights Reserved.

</h5>
</div>

<div class="span4 text-right">
<h5>Powered by <a href="http://divisionforty.com">Division Forty</a></h5>
</div>
</div>

</div>


                </div><!--END FOOTER-BOTTOM-->    

        </div><!--END FOOTER-CONTENT-->        

    </div><!--END FOOTER-->

You can use the built in alignment classes text-left, text-right, and text-center

Is it your design to let footer full width as screen width?

if yes, you just have to change your row class to row-fluid class. Bootstrap 2.3.2 is using row-fluid, not row.

<div id="footer">
     <div id="footer-content">
          <div id="footer-bottom" class="clear">
                  <div class="row-fluid" style="margin: 0 auto;">
    <div class="span12" style="width:100%;">

        <div class="span2 text-left">
        </div>

        <div class="span6 text-center">
        </div>

        <div class="span4 text-right">
        </div>
    </div>
</div>
            </div><!--END FOOTER-BOTTOM-->    
    </div><!--END FOOTER-CONTENT-->        
</div><!--END FOOTER-->

if no, put a container for the width.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!