[英]How to make 2 icons to be aligned one to the left and one to the right?
I tried to search the internet, but I saw nothing.我试图在互联网上搜索,但我什么也没看到。 My problem is very easy, I have 2 icons and want one of them to be aligned to the left and the other on to the right.
我的问题很简单,我有 2 个图标,并希望其中一个与左侧对齐,另一个在右侧对齐。 The code follows:
代码如下:
<div class="container">
<div class="row">
<div style="cursor: pointer" onclick="window.history.back()">
<div class="back-button" data-wow-delay="0.2s" style="padding: 0 0 0 25px">
<div class="icon color-1" style="margin-bottom: 0">
<i class="lni-pointer-left"></i>
</div>
</div>
</div>
<div style="cursor: pointer" onclick="window.history.back()">
<div class="back-button" data-wow-delay="0.2s" style="padding: 0 0 0 25px">
<div class="icon color-1" style="margin-bottom: 0">
<i class="lni-pointer-left"></i>
</div>
</div>
</div>
</div>
</div>
PS: Float: right didn't help... PS:浮动:对没有帮助......
Add This Class d-flex justify-content-between
添加此类
d-flex justify-content-between
<div class="container">
<div class="d-flex justify-content-between">
<div style="cursor: pointer" onclick="window.history.back()">
<div class="back-button" data-wow-delay="0.2s" style="padding: 0 0 0 25px">
<div class="icon color-1" style="margin-bottom: 0">
<i class="lni-pointer-left">Icon 1</i>
</div>
</div>
</div>
<div style="cursor: pointer" onclick="window.history.back()">
<div class="back-button" data-wow-delay="0.2s" style="padding: 0 0 0 25px">
<div class="icon color-1" style="margin-bottom: 0">
<i class="lni-pointer-left">Icon 2</i>
</div>
</div>
</div>
</div>
</div>
https://jsfiddle.net/lalji1051/th05ad8c/1/ https://jsfiddle.net/lalji1051/th05ad8c/1/
flexbox
works best as it offers minimal code. flexbox
效果最好,因为它提供了最少的代码。 follow the example below:请按照以下示例操作:
#icon-row { display: flex; justify-content: space-between; padding: 20px; border: 1px solid lightgrey; } a { cursor: pointer; background-color: lightgrey; padding: 5px; }
<div id="icon-row"> <a>icon</a> <a>icon</a> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.