html - 在 zurb foundation 的列中间对齐文本

标签 html css zurb-foundation

我是 HTML 结构,我需要在一列中放置 Logo ,在其他列中放置标题。

<div class="row">
    <div class="large-3 medium-3 small-12 columns ">
        <img src="http://placehold.it/100x100&text=[Logo 1]" />
    </div>
    <div class="large-9 medium-9 small-12 columns ">This is the Title</div>
</div>
<p></p>
<div class="row">
    <div class="large-3 medium-3 small-12 columns ">
        <img src="http://placehold.it/200x100&text=[Logo 2]" />
    </div>
    <div class="large-9 medium-9 small-12 columns ">This is the Title</div>
</div>

Logo 可以有不同的尺寸,如上例所示。

我想对齐标题。这是一个 fiddle 示例 http://jsfiddle.net/57fBK/15/

最佳答案

你可以像this那样做.

CSS

.mainCnt {
    display: table;
}
.mainCnt .columns {
    display: table-cell;
    vertical-align: middle;
    float: none !important
}

您可以通过提供完整的 CSS 层次结构来删除 !important

添加了一个类 mainCntrow 所以它不会影响其他任何地方。

关于html - 在 zurb foundation 的列中间对齐文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24858770/

相关文章:

javascript - 在输入字段内使用图标后,默认 'input is required/Please fill out this field' 消息不显示

html - 嵌套的 Flexbox 破坏父级

javascript - 我如何覆盖 css 按钮或复选框放置

php - 如何在网站上画矩形突出显示?

javascript - 在 li 中获取特定图像之上的跨度

html - Zurb Foundation 顶部栏下拉菜单和菜单不起作用

javascript - Semantic-ui 弹出 z-index?

css - 如何在两列 div 中水平排序 block ?

css - 防止 Foundation 按钮文本在单击时更改颜色

jquery - animation.css 和基础