I am working on aligning two span
elements should be present in same line but have separated as shown in below. The code i am using is below.
If I do not use float:right
the both texts are coming in single line with attaching one each other.
If I use float:right;
they are not aligning in same line, having some misalignment between them.
with float:right;
the result will be this
without float:right;
the result will be this
Please give me suggestions for this
.clearSpan {
color: $alt-dark-blue;
float: right;
cursor: pointer;
clear: both;
font-size: 10px;
}
.saveSpan {
color: $alt-dark-blue;
clear : both;
cursor: pointer;
font-size: 10px;
}
<div>
<span class="saveSpan" >Save as Default Filters</span>
<span class="clearSpan" >Clear All Filters</span>
</div>
you can use flexbox
for that
div {
display: flex;
justify-content: space-between;
border-bottom: 1px solid grey
}
span {
color: blue;
cursor: pointer;
font-size: 10px;
}
<div>
<span class="saveSpan">Save as Default Filters</span>
<span class="clearSpan">Clear All Filters</span>
</div>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments