【发布时间】:2020-07-06 02:13:36
【问题描述】:
【问题讨论】:
标签: css bootstrap-4
【问题讨论】:
标签: css bootstrap-4
像这样?
span {
display: block;
}
button{
border:none;
padding:0 20px;
}
img{
width:50px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div class='nav'>
<button class="btn">
<img src="https://image.shutterstock.com/image-photo/bright-spring-view-cameo-island-260nw-1048185397.jpg">
<span>Support</span>
</button>
</div>
【讨论】:
img标签中src的值。
样式与nav无关
HTML:
<a class="nav-with-icon">
<img src="/image/path/photo.jpg />
Support
</a>
CSS:
.nav-with-icon {
display: flex;
flex-direction: column;
text-align: center;
}
我没试过,但应该可以。
【讨论】:
span 替换为img。在我的答案中编辑