Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在引导中垂直对齐?_Html_Css_Twitter Bootstrap_Frameworks - Fatal编程技术网

Html 如何在引导中垂直对齐?

Html 如何在引导中垂直对齐?,html,css,twitter-bootstrap,frameworks,Html,Css,Twitter Bootstrap,Frameworks,我尝试垂直对齐一行中的文本,但没有效果 <div class="row direita"> <div class="col-xs-2"></div> <div class="col-xs-4 description"> <h4>Modelo</h4> <p>Y21512</p> <h4>Descrição</h4>

我尝试垂直对齐一行中的文本,但没有效果

<div class="row direita">
    <div class="col-xs-2"></div>
    <div class="col-xs-4 description">
        <h4>Modelo</h4>
        <p>Y21512</p>
        <h4>Descrição</h4>
        <p>
            Vestido de Noiva ombro a ombro com transparência no colo e costas, detalhe
            de cinto em cristais, todo em renda francesa rebordada em pedrarias,
            corte sereia com cauda.
        </p>
        <h4>Tamanhos</h4>
        <p>02 – 28</p>
        <h4>Cores</h4>
        <p>Ivory, White</p>
        <h4>Preço</h4>
        <p>R$400.000,00</p>
        <hr />
        <button class="btn btn-default btn-primary center-block">Comprar</button>
    </div>
    <div class="col-xs-1"></div>
    <div class="col-xs-5">
        <div class="row">
            <div class="col-xs-1"></div>
            <div class="col-xs-11">
                <img src="img/Produtos Cappeli/Vestido07/Y21512.jpg" class="img-responsive pull-right" />
            </div>
        </div>
    </div>
</div>

.esquerda {
    display: inline-block;
}

.description {
    /*padding-top: 110px;*/
    display: inline-block;
    vertical-align: middle;
}

摩洛
Y21512

描述 detalhe Noiva ombro和ombro com transparência不需要colo e costas 在基督教堂里,在圣彼得教堂里, 科尔特·塞雷亚·科达。

塔曼霍斯 02-28

核心 象牙白

普雷西奥 R$400.000,00


购买 埃斯克尔达先生{ 显示:内联块; } .说明{ /*填充顶部:110px*/ 显示:内联块; 垂直对齐:中间对齐; }
我还尝试了在谷歌搜索时发现的一些方法,但都不管用

我试过:

你能给我们举一个你尝试过的例子吗

这对大多数事情都有效

.parent {
    display:table;
}
.child {
    display:table-cell;
    vertical-align:middle;
}

一般来说,要使用CSS垂直对齐文本,您必须创建一个容器,然后可以使用
垂直对齐:middle
对齐文本

CSS:


HTML:


垂直对齐的文本

另一种方法是使父div为相对对象,子对象为绝对对象。然后为您的子对象CSS设置top:50%和transform:translateY(-50%)。

您能给我们看一下您的代码吗?可能是
.container {
  display: inline-block;
}
span {
  display: inline-block;
  vertical-align: middle;
}
<div class="container">
  <span>Vertically aligned text</span>
</div>