Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.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
Css 如何使用Bootstrap 3.0将徽标与同一行中的文本对齐?_Css_Twitter Bootstrap_Twitter Bootstrap 3 - Fatal编程技术网

Css 如何使用Bootstrap 3.0将徽标与同一行中的文本对齐?

Css 如何使用Bootstrap 3.0将徽标与同一行中的文本对齐?,css,twitter-bootstrap,twitter-bootstrap-3,Css,Twitter Bootstrap,Twitter Bootstrap 3,使用Bootstarp3.0,我希望将徽标和文本水平对齐。代码如下所示: <div> <div > <img class="" alt="" src="/img/my_logo.gif"></img> </div> <div > <p>My text</p> </div> </div> 我的文字 我可以使用引导的网格系统,但我不想

使用Bootstarp3.0,我希望将徽标和文本水平对齐。代码如下所示:

<div>        
  <div >
<img class="" alt="" src="/img/my_logo.gif"></img>
  </div>
  <div >
     <p>My text</p>
  </div>
</div>

我的文字


我可以使用引导的网格系统,但我不想定义宽度。我想要的是,第一列with是位图的with,第二列(文本)的with是剩余的空间。

您的div没有引导类

我建议您查看用于对齐div的“”boostrap类

比如说

<div class="row">
  <div class="col-xs-6">img</div>
  <div class="col-xs-6">text</div>
</div>

img
文本

使用引导的
内联列表

  <ul class="list-inline">
    <li><img src="//placehold.it/150x50"></li>
    <li><p>My text</p></li>
  </ul>
  • 我的文字


演示:

这是我第一次尝试,但它将行划分为两个相似的宽度。我需要的是将文本放在靠近徽标的位置,文本宽度必须是剩余的空间。这是可行的,但如何通过顶部垂直对齐?现在,如果文本有许多行,则徽标将在垂直线的中心对齐。