【发布时间】:2017-03-03 09:04:39
【问题描述】:
我有一个标签标题和一个图标,我尝试使用 flex 在垂直和水平方向居中。标签工作正常;唯一的问题是图标。
我希望图标位于标签标题上方而不是旁边。我试过用<br>,还是不行。
下面的代码sn-p和JSFiddle link:
.radio input[type="radio"] + label {
align-items: center;
background-color: white;
border: 1px solid #cccbc8;
display: flex;
height: 150px;
justify-content: center;
position: relative;
width: 150px;
}
<div class="radio-inline radio input_type">
<input id="Best offers" name="54_answer" type="radio" next-question-id="" value="Best offers">
<label for="Best offers">Best offers <br> <i class="fa fa-star-o"></i></label>
</div>
【问题讨论】:
-
我不明白你想要什么。 this 你得到了什么?你把它放在哪里?
-
这里一样,字体很棒的图标不见了
-
尝试在 span 元素中添加图标,看看会发生什么
-
您必须使用fontawesome.io 才能使用图标