I'm trying to center a Row and the spans inside of it with bootsrap.
You can see it in the footer here: http://www.divisionforty.com/wall/
I'd like the social networking icons to be on the left, copyright in the middle the powered by on the right, as it all is.
footer code:
<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" style="text-align: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" style="text-align:center;">
<h5>
Copyright © <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" style="text-align: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-->
Hope someone can help.
Thanks
Denver
<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 © <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.
来源:https://stackoverflow.com/questions/19040301/center-bootstrap-row-and-spans