【发布时间】:2018-11-26 01:18:03
【问题描述】:
我有两张图片想要向右浮动并保持在同一条线上。但是会发生的是万事达卡图像在右侧,而签证卡图像在新行上浮动。有什么帮助吗?谢谢
HTML:
<label>
<img src="{% static 'img/Mastercard.png' %}" style="float:right">
</label>
<div class="clear"></div>
<label>
<img src="{% static 'img/Visa.png' %}" style="float:right">
</label>
<div class="clear"></div>
CSS:
.clear {
clear: both;
}
【问题讨论】:
-
他们之间清空div的目的是什么?
-
即使删除也无济于事
-
删除它,它会有所作为......顺便说一下,你不需要浮动图像,使用 text-align