0
A
回答
1
.navbar-brand {
transform: translateX(-50%);
left: 50%;
position: absolute;
}
实现无线这个。
0
使标签display:block; width:100%
,然后设置与margin:0 auto
图像:
.navbar-brand {
display:block;
width:100%;
}
.navbar-brand img {
margin:0 auto;
}
0
a.navbar-brand {
text-align: center;
display: inline-table;
position: relative;
}
如果neccessary只能去除填充<div class="container-fluid" style="padding-bottom: 30px">
或使其padding-bottom:0;
感谢
0
删除引导类 “导航栏品牌” 和下面的类取代
https://jsfiddle.net/y0yL3gna/3/
.class-name{
text-align: center;
display: block;
}
和HTML将
<div class="wrapper">
<div class="container">
<nav class="navbar bgcol col_org">
<div class="container-fluid" style="padding-bottom: 30px">
<div class="navbar-header">
<a class="class-name" href="#" target="_self"><img src="https://cdn4.iconfinder.com/data/icons/iconsimple-logotypes/512/android-128.png" alt="flower"></a>
</div>
</div>
</nav>
</div>
</div>
0
删除浮动和设置显示:锚点标记和边距的块:0自动将用于img标记。
.navbar-brand {
display:block;
}
.navbar-brand img {
margin: 0 auto;
}
0
我只是用你的风格修改了一些html。尝试这个!
.wrapper {
background: #ccc;
padding-bottom: 10px;
}
.container {
background-color: #FFF;
box-shadow: 0px 2px 13px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0px 2px 13px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px 2px 13px rgba(0, 0, 0, 0.2);
}
.bgcol {
/*background-color: #1d3179;*/
background-color: #000000;
border: #fff;
color: fff
}
.bgcol .navbar-toggle .icon-bar {
background-color: #FFF;
}
.bgcol a {
color: #FFF;
}
.col_org {
background: #1d3179;
}
.col_org:hover {
background: #1d3179;
}
<div class="wrapper">
<div class="container">
<nav class="navbar bgcol col_org">
<div class="container-fluid" style="padding-bottom: 30px">
<div class="navbar-header">
<a class="" style=" width: 100%; display: block;" href="#" target="_self"><img src="https://cdn4.iconfinder.com/data/icons/iconsimple-logotypes/512/android-128.png" style="margin: auto; display: block;" alt="flower"></a>
</div>
</div>
</nav>
</div>
</div>
相关问题
- 1. 如何中心锚标记
- 2. Boostrap中的锚标记中的图像
- 3. CSS图像位于锚标记内的另一图像
- 4. 在锚标记内创建锚标记
- 5. 图像的锚标记XML和XSLT
- 6. 如何调整锚标记内的图像,使其不会从锚标记的内容区域出来
- 7. 中心对齐锚定标记内的跨度
- 8. 范围内的锚标记
- 9. 复制图像的锚标记具有相同的图像SRC
- 10. 锚标记可点击区域比图像内
- 11. 如何将一个锚标记放在一个锚标记内
- 12. 锚定标记内的XHTML内嵌div
- 13. 将图像垂直居中在Flex项目中的锚标记内
- 14. 在锚标记中居中显示bg图像的跨度
- 15. 从锚标记中的图像中删除边框
- 16. 锚标签图像的Joomla
- 17. Internet Explorer 8中的流体图像周围的锚定标记
- 18. XHTML设定为行分解为多个图像中的多个锚标记内
- 19. 如何在锚标记中形成可访问的图像?
- 20. 删除在jquery中选定图像周围的锚标记
- 21. img标签内锚标记...在
- 22. 锚标记内的离子复选框
- 23. 提取锚标记的内容
- 24. link_to中的锚标记
- 25. cakephp中的锚定标记
- 26. 中心图像内画布
- 27. 将图片放在锚标记中
- 28. 在Cleditor中为图像添加锚标记
- 29. 使用Selenium在锚标记中选择图像按钮
- 30. 在标记中使用SVG锚定图像