我想讓圖標顯示在一些文字後面,但它不工作。 我已經使用了該圖標的CSS是此鏈接:文字背後的字體真棒圖標
.fa:not(.form-control-feedback) {
font-size: $h1-size;
color: lighten($brand-color-light, 10%);
z-index: 0;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: -webkit-box; /* Safari */
display: flex;
align-items: center;
justify-content: center;
}
和HTML是這樣的:
<a ui-sref="account({ accountNumber: controller.account.accountNumber })" animated-tile>
<i class="fa fa-user"></i>
<div style="z-index: 2;">
<h3>{{ controller.account.accountNumber }}</h3>
<h5>{{ controller.account.name }}</h5>
<p>
{{ controller.account.address.houseName }}<br ng-if="controller.account.address.houseName.replace(' ', '')" />
{{ controller.account.address.street }}<br ng-if="controller.account.address.street.replace(' ', '')" />
{{ controller.account.address.town }}<br ng-if="controller.account.address.town.replace(' ', '')" />
{{ controller.account.address.county }}<br ng-if="controller.account.address.county.replace(' ', '')" />
{{ controller.account.address.postCode }}
</p>
</div>
</a>
但文字只是出現在後面的圖標。 我嘗試過使用:之前,它仍然無法正常工作。
這裏是我的問題的codepen:
http://codepen.io/r3plica/pen/GZeLQM
,這裏是一個在那裏我將它設置:前
http://codepen.io/r3plica/pen/EKMJLj
人知道如何解決這個問題?
我已經標記了你的答案,因爲我唯一需要的是就是讓文本(或者包含div)相對,而且你是唯一一個說出來的文本,儘管其他人實際上已經在他們的解決方案中使用了它們,但他們從來沒有說過這是我真正需要的。 – r3plica