Html 我需要的解决方案保持图像和文字都在同一形式的中心
图像和文本应该在中间。文本位于中间,但图像位于文本顶部。我希望文本和图像以相同的方式,但只在中心。提前谢谢 下面是我的代码:Html 我需要的解决方案保持图像和文字都在同一形式的中心,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,图像和文本应该在中间。文本位于中间,但图像位于文本顶部。我希望文本和图像以相同的方式,但只在中心。提前谢谢 下面是我的代码: 尼泊尔安全 尼泊尔安全 在这里: 尼泊尔安全 尼泊尔安全 在这里: 尼泊尔安全 尼泊尔安全 这应该可以: <nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <!-- Brand an
尼泊尔安全
尼泊尔安全
在这里:
尼泊尔安全
尼泊尔安全
在这里:
尼泊尔安全
尼泊尔安全
这应该可以:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class='col-md-12-fluid' style="
padding-bottom: 2px;
background-color:#7E8F7C;
">
<div class="row" style="background-color:red !important">
<div class='col-md-8-fluid'>
<!--recently search was here-->
<a class="navbar-brand" href="index.html"></a>
</div>
<div class='col-md-4-fluid' style="background-color:#3B3738; height:25px;">
<h3>Nepal Safety</h3>
</div>
</div>
<div class="row">
<div class='col-md-6'>
<!--recently search was here-->
<a class="navbar-brand" href="index.html" style="float:right;">
<img src="images/iccn.png" height="50px" width="100px">
</a>
</div>
<br>
<div class='col-md-6'>
<h3>Nepal Safety</h3>
</div>
</div>
</div>
<div class='clearfix'></div>
<div class="navbar-header">
尼泊尔安全
尼泊尔安全
我将列更改为6和6,使它们每个都是屏幕宽度的一半。我从列类中删除了“fluid”(因为您已经将包围div设置为fluid,所以不需要它的任何子流体)。最后,我将图像向右浮动,使其位于标题旁边
告诉我这是不是你想要的 这应该有效:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class='col-md-12-fluid' style="
padding-bottom: 2px;
background-color:#7E8F7C;
">
<div class="row" style="background-color:red !important">
<div class='col-md-8-fluid'>
<!--recently search was here-->
<a class="navbar-brand" href="index.html"></a>
</div>
<div class='col-md-4-fluid' style="background-color:#3B3738; height:25px;">
<h3>Nepal Safety</h3>
</div>
</div>
<div class="row">
<div class='col-md-6'>
<!--recently search was here-->
<a class="navbar-brand" href="index.html" style="float:right;">
<img src="images/iccn.png" height="50px" width="100px">
</a>
</div>
<br>
<div class='col-md-6'>
<h3>Nepal Safety</h3>
</div>
</div>
</div>
<div class='clearfix'></div>
<div class="navbar-header">
尼泊尔安全
尼泊尔安全
我将列更改为6和6,使它们每个都是屏幕宽度的一半。我从列类中删除了“fluid”(因为您已经将包围div设置为fluid,所以不需要它的任何子流体)。最后,我将图像向右浮动,使其位于标题旁边
告诉我这是不是你想要的 Crusader,create with issue Behavior Crusader,create with issue Behavior图像必须显示在文本的左侧,并且文本应该正好位于中间图像的右侧。在这里,图像显示在顶部,已经完成#谢谢我已经编辑了代码,您只需设置容器的宽度,
margin:0 auto代码>将使块居中。顺便说一句,图像和标题必须在同一个分区中。图像必须出现在文本的左侧,文本应该正好位于图像的右侧。在这里,图像显示在顶部,已经完成#谢谢我已经编辑了代码,您只需设置容器的宽度,margin:0 auto代码>将使块居中。顺便说一下,图像和标题必须在同一个div中