html - 是否垂直对齐 :center-right; works?

标签 html css

<分区>

我正在尝试使图像在右侧垂直对齐。

.header {   
    background-color:white;
    width:auto;
    height:120px;
}

.title {
    vertical-align:center-right;    
}

<div class="header">
          <div class="title">

                    <a href="home.html"><img src="logo.png"/></a>

          </div><!--TITEL DIV-->
     </div><!--HEADER DIV-->

但是“标题”div 中的内容不会在右中心垂直对齐。

最佳答案

.title{
    vertical-align: middle;
    text-align: right;
}

关于html - 是否垂直对齐 :center-right; works?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42556869/

上一篇:css - Wordpress:水平菜单居中和菜单周围神秘填充的 CSS 问题

下一篇:html - CSS 否定伪类 :not() for parent/ancestor elements

相关文章:

html - 如果文本太长,为什么图像不居中? (使用显示 : table; margin: 0 auto; to horizontally center)

html - 图像标签中 "Natural 1x1"的含义

javascript - 在使用 Bootstrap 3 选项卡更改选项卡之前如何要求确认?

javascript - 加载页面后如何调用函数自动执行

html - 将跨度添加到中心对齐元素的一侧

php - 如何使用 heatmap.js 保存 canvas 标签生成的图像文件?

html - 如何在 ng-grid 表格中添加 <caption> 标签?

javascript - JS 更新时 iFrame 无法正常显示

html - 将表单标签对齐到输入的左侧

css - 带有 div 的 HTML CSS 网格 3x3