zurb foundation center content in the grid

跟風遠走 提交于 2019-12-03 09:29:24

Edit November 2015: In Foundation 6 check out Typography Helpers


Edit April 2014: In Foundation 5 check out Utility classes.


Original answer:

Use the text-center class.

<div class="row">
    <div class="twelve columns text-center"><br />
        <img src="img_06.jpeg" alt="slide image">
    </div>
</div>

Source: https://github.com/zurb/foundation/pull/224

Try adding the centered class.

.five.columns.centered

Just add the class "text-center"

Using foundation 4:

HTML:

<div class="row">
    <div id="wrap-img" class="large-12 columns"><br />
        <img src="img_06.jpeg" alt="slide image">
    </div>
</div>

CSS:

#wrap-img img { margin: 0 auto; }

The only way I can get an image centered in Foundation 4 is to change to display:block; for img instead of display:inline-block;

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