Smythu Smythu - 5 months ago 8
CSS Question

Float right table doesnt work

I tried to apply the float: right to the button and the text but its just not working because it destroys everything.

any ideas?

<hr>
<div class="table">
<div class="row">
<a href="#" class="btn-primary left-cell"><i class="fa fa-refresh" aria-hidden="true" style="margin-right: 4px;"></i> Aktualisieren</a>
<span class="right-cell"> 14 neue Meldungen</span>
</div>
</div>
<hr>


https://jsfiddle.net/uoyh2fk9/

Answer

Not sure what, "destroys everything" means, but it sounds like flexbox might work better for what you are trying to achieve. Remove the display: table's from your divs and try the following:

CSS

.row {
  display: flex;
  justify-content: flex-end;
}

JSFiddle

If you would like to know more about flexbox and how it works, here is a link.

Comments