图片和文字应该居中。文本位于中心,但图像位于文本顶部。我想要文本和图像以相同的方式但只在中心。提前致谢
下面是我的代码:
<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-8-fluid'>
<!--recently search was here-->
<a class="navbar-brand" href="index.html">
<img src="images/iccn.png" height="50px" width="100px">
</a>
</div>
<br>
<div class='col-md-4-fluid'>
<h3>Nepal Safety</h3>
</div>
</div>
</div>
<div class='clearfix'></div>
<div class="navbar-header">
最佳答案
这里是:
<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; min-height: 500px;">
<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" style="clear: both">
<div class='col-md-8-fluid' style="width: 500px; margin: 0 auto; background: blue">
<!--recently search was here-->
<a class="navbar-brand" href="index.html" style="float: left">
<img src="images/iccn.png" height="50px" width="100px">
</a>
<h3>Nepal Safety</h3>
</div>
</div>
</div>
<div class='clearfix'></div>
<div class="navbar-header">
关于html - 我需要将图像和文本以相同形式保持在中心的解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37021486/